[Server] Update OnObjectPlace and OnObjectDelete callbacks

pull/163/head
David Cernat 8 years ago
parent 87dce73b90
commit 8c019f2c61

@ -425,7 +425,6 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
} }
worldEvent = new WorldEvent(player->guid); worldEvent = new WorldEvent(player->guid);
mwmp::WorldObject worldObject;
switch (packet->data[0]) switch (packet->data[0])
{ {
@ -438,14 +437,9 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
myPacket->Read(worldEvent); myPacket->Read(worldEvent);
myPacket->Send(worldEvent, true); myPacket->Send(worldEvent, true);
for (unsigned int i = 0; i < worldEvent->objectChanges.count; i++) Script::Call<Script::CallbackIdentity("OnObjectPlace")>(
{ player->getId(),
worldObject = worldEvent->objectChanges.objects[i]; worldEvent->cell.getDescription().c_str());
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(
player->getId(),
worldEvent->cell.getDescription().c_str());
}
break; break;
} }
@ -458,16 +452,9 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
myPacket->Read(worldEvent); myPacket->Read(worldEvent);
myPacket->Send(worldEvent, true); myPacket->Send(worldEvent, true);
ESM::CellRef cellRef; Script::Call<Script::CallbackIdentity("OnObjectDelete")>(
player->getId(),
for (unsigned int i = 0; i < worldEvent->objectChanges.count; i++) worldEvent->cell.getDescription().c_str());
{
worldObject = worldEvent->objectChanges.objects[i];
Script::Call<Script::CallbackIdentity("OnObjectDelete")>(
player->getId(),
worldEvent->cell.getDescription().c_str());
}
break; break;
} }

Loading…
Cancel
Save