forked from mirror/openmw-tes3mp
Send an ID_WORLD_OBJECT_DELETE whenever ingame scripts delete objects
This commit is contained in:
parent
0a44bea91d
commit
025a847fd1
1 changed files with 12 additions and 0 deletions
|
@ -2,6 +2,9 @@
|
|||
|
||||
#include <cstdlib>
|
||||
|
||||
#include <components/openmw-mp/Base/WorldEvent.hpp>
|
||||
#include "../mwmp/Main.hpp"
|
||||
|
||||
#include <components/compiler/extensions.hpp>
|
||||
#include <components/compiler/opcodes.hpp>
|
||||
#include <components/compiler/locals.hpp>
|
||||
|
@ -668,7 +671,16 @@ namespace MWScript
|
|||
runtime.pop();
|
||||
|
||||
if (parameter == 1)
|
||||
{
|
||||
// Added by tes3mp
|
||||
mwmp::WorldEvent *event = mwmp::Main::get().getNetworking()->createWorldEvent();
|
||||
event->cell = *ptr.getCell()->getCell();
|
||||
event->cellRef.mRefID = ptr.getCellRef().getRefId();
|
||||
event->cellRef.mRefNum = ptr.getCellRef().getRefNum();
|
||||
mwmp::Main::get().getNetworking()->GetWorldPacket(ID_WORLD_OBJECT_DELETE)->Send(event);
|
||||
|
||||
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
||||
}
|
||||
else if (parameter == 0)
|
||||
MWBase::Environment::get().getWorld()->undeleteObject(ptr);
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue