[Quest API] Add GetGMStatus() to Perl/Lua. (#2448)

* [Quest API] Add GetGMStatus() to Perl/Lua.

- Add $client->GetGMStatus() to Perl.
- Add client:GetGMStatus() to Lua.
- Fix client:Admin() using Lua_Safe_Call_Bool().

This is just a more descriptive form of $client->Admin() in Perl and client:Admin() in Lua.

* Update lua_client.cpp

* Update perl_client.cpp
This commit is contained in:
Kinglykrab
2022-09-28 04:03:07 -04:00
committed by GitHub
parent 90406e0328
commit 959a17daea
3 changed files with 23 additions and 10 deletions
+8 -2
View File
@@ -409,7 +409,7 @@ std::string Perl_Client_AccountName(Client* self) // @categories Account and Cha
return self->AccountName();
}
int Perl_Client_Admin(Client* self) // @categories Account and Character
int16 Perl_Client_Admin(Client* self) // @categories Account and Character
{
return self->Admin();
}
@@ -1227,12 +1227,17 @@ void Perl_Client_ReadBook(Client* self, const char* book_text, uint8 type) // @c
self->QuestReadBook(book_text, type);
}
void Perl_Client_SetGMStatus(Client* self, int new_status) // @categories Script Utility
void Perl_Client_SetGMStatus(Client* self, int16 new_status) // @categories Script Utility
{
self->SetGMStatus(new_status);
self->UpdateAdmin(true);
}
int16 Perl_Client_GetGMStatus(Client* self) // @categories Account and Character
{
return self->Admin();
}
void Perl_Client_UpdateGroupAAs(Client* self, int points, uint32 type) // @categories Alternative Advancement, Group
{
self->UpdateGroupAAs(points, type);
@@ -2616,6 +2621,7 @@ void perl_register_client()
package.add("GetFreeSpellBookSlot", (int(*)(Client*))&Perl_Client_GetFreeSpellBookSlot);
package.add("GetFreeSpellBookSlot", (int(*)(Client*, uint32))&Perl_Client_GetFreeSpellBookSlot);
package.add("GetGM", &Perl_Client_GetGM);
package.add("GetGMStatus", &Perl_Client_GetGMStatus);
package.add("GetGroup", &Perl_Client_GetGroup);
package.add("GetGroupPoints", &Perl_Client_GetGroupPoints);
package.add("GetHorseId", &Perl_Client_GetHorseId);