mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-16 18:19:55 +00:00
[Server] Add script callbacks for object placement and deletion
This commit is contained in:
parent
35e453dec3
commit
f9feaf05f0
3 changed files with 15 additions and 0 deletions
|
@ -418,6 +418,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
myPacket->Read(event);
|
||||
myPacket->Send(event, true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnObjectPlace")>(
|
||||
player->getId(),
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
event->cell.getDescription().c_str());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -435,6 +441,12 @@ void Networking::processWorldPacket(RakNet::Packet *packet)
|
|||
|
||||
myPacket->Send(event, true);
|
||||
|
||||
Script::Call<Script::CallbackIdentity("OnObjectDelete")>(
|
||||
player->getId(),
|
||||
event->cellRef.mRefID.c_str(),
|
||||
event->cellRef.mRefNum.mIndex,
|
||||
event->cell.getDescription().c_str());
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
#define QUESTAPI \
|
||||
{"GetJournalChangesSize", QuestFunctions::GetJournalChangesSize},\
|
||||
\
|
||||
{"AddJournalEntry", QuestFunctions::AddJournalEntry},\
|
||||
{"AddJournalIndex", QuestFunctions::AddJournalIndex},\
|
||||
\
|
||||
{"GetJournalItemQuest", QuestFunctions::GetJournalItemQuest},\
|
||||
|
|
|
@ -114,6 +114,8 @@ public:
|
|||
{"OnPlayerChangeInventory", Function<void, unsigned short>()},
|
||||
{"OnPlayerChangeSpellbook", Function<void, unsigned short, int>()},
|
||||
{"OnPlayerChangeJournal", Function<void, unsigned short>()},
|
||||
{"OnObjectPlace", Function<void, unsigned short, const char*, int, const char*>()},
|
||||
{"OnObjectDelete", Function<void, unsigned short, const char*, int, const char*>()},
|
||||
{"OnPlayerSendMessage", Function<bool, unsigned short, const char*>()},
|
||||
{"OnPlayerEndCharGen", Function<void, unsigned short>()},
|
||||
{"OnGUIAction", Function<void, unsigned short, int, const char*>()}
|
||||
|
|
Loading…
Reference in a new issue