mirror of
https://github.com/OpenFusionProject/OpenFusion.git
synced 2025-12-23 04:10:06 +00:00
[refactor] Remove redundant coord args from most entity constructors
Mobs and CombatNPCs still need theirs in order to properly set their roaming and spawn coords. Assignment of the latter has been moved to the CombatNPC constructor, where it should have already been.
This commit is contained in:
@@ -122,7 +122,6 @@ static void npcUnsummonHandler(CNSocket* sock, CNPacketData* data) {
|
||||
// type must already be checked and updateNPCPosition() must be called on the result
|
||||
BaseNPC *NPCManager::summonNPC(int x, int y, int z, uint64_t instance, int type, bool respawn, bool baseInstance) {
|
||||
uint64_t inst = baseInstance ? MAPNUM(instance) : instance;
|
||||
#define EXTRA_HEIGHT 0
|
||||
|
||||
//assert(nextId < INT32_MAX);
|
||||
int id = nextId--;
|
||||
@@ -130,12 +129,12 @@ BaseNPC *NPCManager::summonNPC(int x, int y, int z, uint64_t instance, int type,
|
||||
BaseNPC *npc = nullptr;
|
||||
|
||||
if (team == 2) {
|
||||
npc = new Mob(x, y, z + EXTRA_HEIGHT, inst, type, NPCData[type], id);
|
||||
npc = new Mob(x, y, z, inst, type, NPCData[type], id);
|
||||
|
||||
// re-enable respawning, if desired
|
||||
((Mob*)npc)->summoned = !respawn;
|
||||
} else
|
||||
npc = new BaseNPC(x, y, z + EXTRA_HEIGHT, 0, inst, type, id);
|
||||
npc = new BaseNPC(0, inst, type, id);
|
||||
|
||||
NPCs[id] = npc;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user