mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +00:00
[Bug Fix] Fix Flag Updating with SetGMStatus() in Lua. (#2554)
# Notes - Perl was sending `UpdateAdmin()` after `SetGMStatus()`, Lua wasn't, so only Perl was updating properly. - Fix is to just put `UpdateAdmin()` inside `SetGMStatus()`.
This commit is contained in:
parent
5173a9179b
commit
e2dfbeb116
@ -1199,7 +1199,7 @@ void Client::ChannelMessageReceived(uint8 chan_num, uint8 language, uint8 lang_s
|
||||
CheckEmoteHail(t, message);
|
||||
|
||||
if (DistanceNoZ(m_Position, t->GetPosition()) <= RuleI(Range, Say)) {
|
||||
|
||||
|
||||
parse->EventNPC(EVENT_SAY, t, this, message, language);
|
||||
|
||||
if (RuleB(TaskSystem, EnableTaskSystem)) {
|
||||
@ -1680,19 +1680,18 @@ void Client::FriendsWho(char *FriendsString) {
|
||||
}
|
||||
}
|
||||
|
||||
void Client::UpdateAdmin(bool iFromDB) {
|
||||
void Client::UpdateAdmin(bool from_database) {
|
||||
int16 tmp = admin;
|
||||
if (iFromDB)
|
||||
if (from_database) {
|
||||
admin = database.CheckStatus(account_id);
|
||||
if (tmp == admin && iFromDB)
|
||||
return;
|
||||
}
|
||||
|
||||
if(m_pp.gm)
|
||||
{
|
||||
if (tmp == admin && from_database) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (m_pp.gm) {
|
||||
LogInfo("[{}] - [{}] is a GM", __FUNCTION__ , GetName());
|
||||
// no need for this, having it set in pp you already start as gm
|
||||
// and it's also set in your spawn packet so other people see it too
|
||||
// SendAppearancePacket(AT_GM, 1, false);
|
||||
petition_list.UpdateGMQueue();
|
||||
}
|
||||
|
||||
@ -10786,9 +10785,11 @@ void Client::RemoveItem(uint32 item_id, uint32 quantity)
|
||||
}
|
||||
}
|
||||
|
||||
void Client::SetGMStatus(int newStatus) {
|
||||
if (Admin() != newStatus)
|
||||
database.UpdateGMStatus(AccountID(), newStatus);
|
||||
void Client::SetGMStatus(int16 new_status) {
|
||||
if (Admin() != new_status) {
|
||||
database.UpdateGMStatus(AccountID(), new_status);
|
||||
UpdateAdmin();
|
||||
}
|
||||
}
|
||||
|
||||
void Client::ApplyWeaponsStance()
|
||||
|
||||
@ -707,7 +707,7 @@ public:
|
||||
inline int GetAccountCreation() const { return account_creation; }
|
||||
inline int16 Admin() const { return admin; }
|
||||
inline uint32 CharacterID() const { return character_id; }
|
||||
void UpdateAdmin(bool iFromDB = true);
|
||||
void UpdateAdmin(bool from_database = true);
|
||||
void UpdateWho(uint8 remove = 0);
|
||||
bool GMHideMe(Client* client = 0);
|
||||
|
||||
@ -1554,7 +1554,7 @@ public:
|
||||
void LoadAccountFlags();
|
||||
void SetAccountFlag(std::string flag, std::string val);
|
||||
std::string GetAccountFlag(std::string flag);
|
||||
void SetGMStatus(int newStatus);
|
||||
void SetGMStatus(int16 new_status);
|
||||
float GetDamageMultiplier(EQ::skills::SkillType how_long_has_this_been_missing);
|
||||
void Consume(const EQ::ItemData *item, uint8 type, int16 slot, bool auto_consume);
|
||||
void PlayMP3(const char* fname);
|
||||
|
||||
@ -2613,6 +2613,16 @@ void Lua_Client::SendMarqueeMessage(uint32 type, uint32 priority, uint32 fade_in
|
||||
self->SendMarqueeMessage(type, priority, fade_in, fade_out, duration, message);
|
||||
}
|
||||
|
||||
void Lua_Client::UpdateAdmin() {
|
||||
Lua_Safe_Call_Void();
|
||||
self->UpdateAdmin();
|
||||
}
|
||||
|
||||
void Lua_Client::UpdateAdmin(bool from_database) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->UpdateAdmin(from_database);
|
||||
}
|
||||
|
||||
#ifdef BOTS
|
||||
|
||||
int Lua_Client::GetBotRequiredLevel()
|
||||
@ -3156,6 +3166,8 @@ luabind::scope lua_register_client() {
|
||||
.def("UntrainDiscAll", (void(Lua_Client::*)(void))&Lua_Client::UntrainDiscAll)
|
||||
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16))&Lua_Client::UntrainDiscBySpellID)
|
||||
.def("UntrainDiscBySpellID", (void(Lua_Client::*)(uint16,bool))&Lua_Client::UntrainDiscBySpellID)
|
||||
.def("UpdateAdmin", (void(Lua_Client::*)(void))&Lua_Client::UpdateAdmin)
|
||||
.def("UpdateAdmin", (void(Lua_Client::*)(bool))&Lua_Client::UpdateAdmin)
|
||||
.def("UpdateGroupAAs", (void(Lua_Client::*)(int,uint32))&Lua_Client::UpdateGroupAAs)
|
||||
.def("UpdateLDoNPoints", (void(Lua_Client::*)(uint32,int))&Lua_Client::UpdateLDoNPoints)
|
||||
.def("UpdateTaskActivity", (void(Lua_Client::*)(int,int,int))&Lua_Client::UpdateTaskActivity)
|
||||
|
||||
@ -434,6 +434,8 @@ public:
|
||||
bool HasItemEquippedByID(uint32 item_id);
|
||||
int GetHealAmount();
|
||||
int GetSpellDamage();
|
||||
void UpdateAdmin();
|
||||
void UpdateAdmin(bool from_database);
|
||||
|
||||
int GetEnvironmentDamageModifier();
|
||||
void SetEnvironmentDamageModifier(int value);
|
||||
|
||||
@ -424,9 +424,9 @@ void Perl_Client_UpdateAdmin(Client* self) // @categories Account and Character
|
||||
self->UpdateAdmin();
|
||||
}
|
||||
|
||||
void Perl_Client_UpdateAdmin(Client* self, bool from_db) // @categories Account and Character
|
||||
void Perl_Client_UpdateAdmin(Client* self, bool from_database) // @categories Account and Character
|
||||
{
|
||||
self->UpdateAdmin(from_db);
|
||||
self->UpdateAdmin(from_database);
|
||||
}
|
||||
|
||||
void Perl_Client_UpdateWho(Client* self) // @categories Script Utility
|
||||
@ -1230,7 +1230,6 @@ void Perl_Client_ReadBook(Client* self, const char* book_text, uint8 type) // @c
|
||||
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user