mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-17 10:30:05 +00:00
[WIP] Convert all chunk-related logic to the new system's semantics
Replaced all references to chunk->players and chunk->NPCs with chunk->entities and all instances of the old NPCClass enum with EntityType. The server compiles but will not yet run properly.
This commit is contained in:
@@ -53,8 +53,8 @@ struct Mob : public BaseNPC {
|
||||
// temporary; until we're sure what's what
|
||||
nlohmann::json data;
|
||||
|
||||
Mob(int x, int y, int z, int angle, uint64_t iID, int type, nlohmann::json d, int32_t id)
|
||||
: BaseNPC(x, y, z, angle, iID, type, id),
|
||||
Mob(int x, int y, int z, int angle, uint64_t iID, int t, nlohmann::json d, int32_t id)
|
||||
: BaseNPC(x, y, z, angle, iID, t, id),
|
||||
maxHealth(d["m_iHP"]),
|
||||
sightRange(d["m_iSightRange"]) {
|
||||
state = MobState::ROAMING;
|
||||
@@ -78,12 +78,12 @@ struct Mob : public BaseNPC {
|
||||
// NOTE: there appear to be discrepancies in the dump
|
||||
appearanceData.iHP = maxHealth;
|
||||
|
||||
npcClass = NPC_MOB;
|
||||
type = EntityType::MOB;
|
||||
}
|
||||
|
||||
// constructor for /summon
|
||||
Mob(int x, int y, int z, uint64_t iID, int type, nlohmann::json d, int32_t id)
|
||||
: Mob(x, y, z, 0, iID, type, d, id) {
|
||||
Mob(int x, int y, int z, uint64_t iID, int t, nlohmann::json d, int32_t id)
|
||||
: Mob(x, y, z, 0, iID, t, d, id) {
|
||||
summoned = true; // will be despawned and deallocated when killed
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user