diff --git a/apps/openmw-mp/Cell.cpp b/apps/openmw-mp/Cell.cpp index 61135c62c..6b37b5888 100644 --- a/apps/openmw-mp/Cell.cpp +++ b/apps/openmw-mp/Cell.cpp @@ -8,6 +8,7 @@ #include #include "Player.hpp" +#include "Script/Script.hpp" using namespace std; @@ -38,6 +39,8 @@ void Cell::addPlayer(Player *player) LOG_APPEND(Log::LOG_INFO, "- Adding %s to Cell %s", player->npc.mName.c_str(), getDescription().c_str()); + Script::Call(player->getId(), getDescription().c_str()); + players.push_back(player); } @@ -57,6 +60,8 @@ void Cell::removePlayer(Player *player) LOG_APPEND(Log::LOG_INFO, "- Removing %s from Cell %s", player->npc.mName.c_str(), getDescription().c_str()); + Script::Call(player->getId(), getDescription().c_str()); + players.erase(it); return; } diff --git a/apps/openmw-mp/CellController.cpp b/apps/openmw-mp/CellController.cpp index 63064af9e..48330c53e 100644 --- a/apps/openmw-mp/CellController.cpp +++ b/apps/openmw-mp/CellController.cpp @@ -116,7 +116,7 @@ void CellController::removeCell(Cell *cell) { if (*it != nullptr && *it == cell) { - Script::Call(cell->getDescription().c_str()); + Script::Call(cell->getDescription().c_str()); LOG_APPEND(Log::LOG_INFO, "- Removing %s from CellController", cell->getDescription().c_str()); delete *it; diff --git a/apps/openmw-mp/Script/ScriptFunctions.hpp b/apps/openmw-mp/Script/ScriptFunctions.hpp index 9651e1c44..6fd03c964 100644 --- a/apps/openmw-mp/Script/ScriptFunctions.hpp +++ b/apps/openmw-mp/Script/ScriptFunctions.hpp @@ -115,7 +115,6 @@ public: {"OnPlayerDeath", Function()}, {"OnPlayerResurrect", Function()}, {"OnPlayerCellChange", Function()}, - {"OnPlayerCellState", Function()}, {"OnPlayerAttributesChange", Function()}, {"OnPlayerSkillsChange", Function()}, {"OnPlayerLevelChange", Function()}, @@ -124,10 +123,11 @@ public: {"OnPlayerInventoryChange", Function()}, {"OnPlayerSpellbookChange", Function()}, {"OnPlayerJournalChange", Function()}, - {"OnCellUnload", Function()}, + {"OnCellLoad", Function()}, + {"OnCellUnload", Function()}, + {"OnCellDeletion", Function()}, {"OnActorList", Function()}, {"OnActorCellChange", Function()}, - {"OnActorStatsDynamic", Function()}, {"OnActorTest", Function()}, {"OnObjectPlace", Function()}, {"OnObjectDelete", Function()}, diff --git a/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp b/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp index c91c86a45..a242ab8a1 100644 --- a/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp +++ b/apps/openmw-mp/processors/player/ProcessorPlayerCellState.hpp @@ -28,8 +28,6 @@ namespace mwmp LOG_MESSAGE_SIMPLE(Log::LOG_INFO, "Received %s from %s", strPacketID, player.npc.mName.c_str()); CellController::get()->update(&player); - - Script::Call(player.getId()); } }; }