added basework for instancing

This commit is contained in:
2020-09-30 20:44:37 -05:00
parent 8ff97ec0b3
commit 4cd7b7cb53
11 changed files with 61 additions and 47 deletions

View File

@@ -42,8 +42,8 @@ struct Mob : public BaseNPC {
// temporary; until we're sure what's what
nlohmann::json data;
Mob(int x, int y, int z, int type, int hp, int angle, nlohmann::json d, int32_t id)
: BaseNPC(x, y, z, type, id), maxHealth(hp) {
Mob(int x, int y, int z, int iID, int type, int hp, int angle, nlohmann::json d, int32_t id)
: BaseNPC(x, y, z, iID, type, id), maxHealth(hp) {
state = MobState::ROAMING;
data = d;
@@ -68,8 +68,8 @@ struct Mob : public BaseNPC {
}
// constructor for /summon
Mob(int x, int y, int z, int type, nlohmann::json d, int32_t id)
: Mob(x, y, z, type, 0, 0, d, id) {
Mob(int x, int y, int z, int iID, int type, nlohmann::json d, int32_t id)
: Mob(x, y, z, iID, type, 0, 0, d, id) {
summoned = true; // will be despawned and deallocated when killed
appearanceData.iHP = maxHealth = d["m_iHP"];
}