forked from mirror/openmw-tes3mp
[Client] Delete new LocalEvents after sending them
This commit is contained in:
parent
239c1aaebf
commit
703f253712
10 changed files with 45 additions and 0 deletions
|
@ -93,6 +93,9 @@ namespace MWGui
|
|||
worldObject.refNumIndex,
|
||||
worldObject.count);
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
return dropped;
|
||||
}
|
||||
|
||||
|
|
|
@ -644,6 +644,8 @@ namespace MWGui
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
// remove from world
|
||||
MWBase::Environment::get().getWorld()->deleteObject (object);
|
||||
|
|
|
@ -68,6 +68,8 @@ namespace MWMechanics
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_UNLOCK)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
lock.getClass().unlock(lock);
|
||||
resultMessage = "#{sLockSuccess}";
|
||||
|
|
|
@ -77,6 +77,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_ANIM_PLAY)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getMechanicsManager()->playAnimationGroup (ptr, group, mode, std::numeric_limits<int>::max(), true);
|
||||
|
|
|
@ -207,6 +207,9 @@ namespace MWScript
|
|||
event->cell.getDescription().c_str(),
|
||||
worldObject.index,
|
||||
worldObject.shortVal);
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -248,6 +251,9 @@ namespace MWScript
|
|||
event->cell.getDescription().c_str(),
|
||||
worldObject.index,
|
||||
worldObject.floatVal);
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -307,6 +313,9 @@ namespace MWScript
|
|||
LOG_MESSAGE_SIMPLE(Log::LOG_VERBOSE, "Sending ID_SCRIPT_GLOBAL_SHORT\n- varName: %s\n- shortVal: %i",
|
||||
worldObject.varName.c_str(),
|
||||
worldObject.shortVal);
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
}
|
||||
|
||||
MWBase::Environment::get().getWorld()->setGlobalInt (name, value);
|
||||
|
@ -646,6 +655,9 @@ namespace MWScript
|
|||
worldObject.refId.c_str(),
|
||||
worldObject.index,
|
||||
worldObject.shortVal);
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -98,6 +98,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_VIDEO_PLAY)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
MWBase::Environment::get().getWindowManager()->playVideo (name, allowSkipping);
|
||||
}
|
||||
|
@ -208,6 +210,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_LOCK)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
ptr.getClass().lock (ptr, lockLevel);
|
||||
|
||||
|
@ -245,6 +249,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_UNLOCK)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
ptr.getClass().unlock (ptr);
|
||||
}
|
||||
|
@ -716,6 +722,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_DELETE)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
MWBase::Environment::get().getWorld()->deleteObject(ptr);
|
||||
}
|
||||
|
|
|
@ -78,6 +78,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_MUSIC_PLAY)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
MWBase::Environment::get().getSoundManager()->streamMusic (sound);
|
||||
}
|
||||
|
|
|
@ -57,6 +57,8 @@ namespace MWScript
|
|||
event->addObject(worldObject);
|
||||
|
||||
mwmp::Main::get().getNetworking()->getWorldPacket(ID_OBJECT_SCALE)->Send(event);
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
MWBase::Environment::get().getWorld()->scaleObject(ptr,scale);
|
||||
}
|
||||
|
@ -570,6 +572,9 @@ namespace MWScript
|
|||
worldObject.refId.c_str(),
|
||||
worldObject.refNumIndex,
|
||||
worldObject.count);
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -41,6 +41,9 @@ namespace MWWorld
|
|||
getTarget().getCellRef().getRefNum().mIndex,
|
||||
event->cell.getDescription().c_str());
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
// LocalPlayer's inventory has changed, so send a packet with it
|
||||
mwmp::Main::get().getLocalPlayer()->sendInventory();
|
||||
|
||||
|
|
|
@ -2283,6 +2283,9 @@ namespace MWWorld
|
|||
event->cell.getDescription().c_str(),
|
||||
worldObject.state ? "true" : "false");
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
door.getClass().setDoorState(door, state);
|
||||
mDoorStates[door] = state;
|
||||
}
|
||||
|
@ -2307,6 +2310,9 @@ namespace MWWorld
|
|||
event->cell.getDescription().c_str(),
|
||||
worldObject.state ? "true" : "false");
|
||||
|
||||
delete event;
|
||||
event = nullptr;
|
||||
|
||||
door.getClass().setDoorState(door, state);
|
||||
mDoorStates[door] = state;
|
||||
if (state == 0)
|
||||
|
|
Loading…
Reference in a new issue