[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:
2021-03-21 03:54:24 +01:00
parent 224ffe05e7
commit 0c8e209360
13 changed files with 119 additions and 107 deletions

View File

@@ -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
}