1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-21 11:23:51 +00:00

[Server] Add ObjectFunctions for setting summoner identity for spawns

This commit is contained in:
David Cernat 2019-12-01 10:12:13 +02:00
parent c6542ffec4
commit 47b666c1f9
2 changed files with 49 additions and 1 deletions

View file

@ -409,13 +409,34 @@ void ObjectFunctions::SetObjectSummonDuration(float summonDuration) noexcept
tempObject.summonDuration = summonDuration; tempObject.summonDuration = summonDuration;
} }
void ObjectFunctions::SetObjectSummonerPid(unsigned short pid) noexcept
{
Player *player;
GET_PLAYER(pid, player, );
tempObject.master.isPlayer = true;
tempObject.master.guid = player->guid;
}
void ObjectFunctions::SetObjectSummonerRefNum(int refNum) noexcept
{
tempObject.master.isPlayer = false;
tempObject.master.refNum = refNum;
}
void ObjectFunctions::SetObjectSummonerMpNum(int mpNum) noexcept
{
tempObject.master.isPlayer = false;
tempObject.master.mpNum = mpNum;
}
void ObjectFunctions::SetObjectActivatingPid(unsigned short pid) noexcept void ObjectFunctions::SetObjectActivatingPid(unsigned short pid) noexcept
{ {
Player *player; Player *player;
GET_PLAYER(pid, player, ); GET_PLAYER(pid, player, );
tempObject.activatingActor.guid = player->guid;
tempObject.activatingActor.isPlayer = true; tempObject.activatingActor.isPlayer = true;
tempObject.activatingActor.guid = player->guid;
} }
void ObjectFunctions::SetObjectDoorState(int doorState) noexcept void ObjectFunctions::SetObjectDoorState(int doorState) noexcept

View file

@ -88,6 +88,9 @@
\ \
{"SetObjectSummonState", ObjectFunctions::SetObjectSummonState},\ {"SetObjectSummonState", ObjectFunctions::SetObjectSummonState},\
{"SetObjectSummonDuration", ObjectFunctions::SetObjectSummonDuration},\ {"SetObjectSummonDuration", ObjectFunctions::SetObjectSummonDuration},\
{"SetObjectSummonerPid", ObjectFunctions::SetObjectSummonerPid},\
{"SetObjectSummonerRefNum", ObjectFunctions::SetObjectSummonerRefNum},\
{"SetObjectSummonerMpNum", ObjectFunctions::SetObjectSummonerMpNum},\
\ \
{"SetObjectActivatingPid", ObjectFunctions::SetObjectActivatingPid},\ {"SetObjectActivatingPid", ObjectFunctions::SetObjectActivatingPid},\
\ \
@ -789,6 +792,30 @@ public:
*/ */
static void SetObjectSummonDuration(float summonDuration) noexcept; static void SetObjectSummonDuration(float summonDuration) noexcept;
/**
* \brief Set the player ID of the summoner of the temporary object stored on the server.
*
* \param pid The player ID of the summoner.
* \return void
*/
static void SetObjectSummonerPid(unsigned short pid) noexcept;
/**
* \brief Set the refNum of the actor summoner of the temporary object stored on the server.
*
* \param refNum The refNum of the summoner.
* \return void
*/
static void SetObjectSummonerRefNum(int refNum) noexcept;
/**
* \brief Set the mpNum of the actor summoner of the temporary object stored on the server.
*
* \param mpNum The mpNum of the summoner.
* \return void
*/
static void SetObjectSummonerMpNum(int mpNum) noexcept;
/** /**
* \brief Set the player ID of the player activating the temporary object stored on the * \brief Set the player ID of the player activating the temporary object stored on the
* server. Currently only used for ObjectActivate packets. * server. Currently only used for ObjectActivate packets.