Summoned mobs are now actually treated as mobs.

Unfortunetly, this necessitated keeping around yet more JSON objects for
the duration of the server's runtime.
It also involved unifying the way NPC IDs are handled, such that they
may be allocated and deallocated out of order.

If any NPCID-related bugs occour, this commit should be regarded as
the prime suspect.
This commit is contained in:
2020-09-25 00:36:25 +02:00
parent cfb3d25bc5
commit 72d625fd8d
8 changed files with 65 additions and 33 deletions

View File

@@ -8,7 +8,7 @@ public:
NPCClass npcClass;
BaseNPC() {};
BaseNPC(int x, int y, int z, int type) {
BaseNPC(int x, int y, int z, int type, int id) {
appearanceData.iX = x;
appearanceData.iY = y;
appearanceData.iZ = z;
@@ -17,11 +17,9 @@ public:
appearanceData.iAngle = 0;
appearanceData.iConditionBitFlag = 0;
appearanceData.iBarkerType = 0;
// hopefully no collisions happen :eyes:
appearanceData.iNPC_ID = (int32_t)rand();
appearanceData.iNPC_ID = id;
};
BaseNPC(int x, int y, int z, int type, NPCClass classType) : BaseNPC(x, y, z, type) {
BaseNPC(int x, int y, int z, int type, int id, NPCClass classType) : BaseNPC(x, y, z, type, id) {
npcClass = classType;
}
};