misc code cleanup

This commit is contained in:
Emagi 2025-06-14 08:01:58 -04:00
parent d5e19e145c
commit 920ea11961
2 changed files with 1 additions and 16 deletions

View File

@ -3192,20 +3192,7 @@ void Commands::Process(int32 index, EQ2_16BitString* command_parms, Client* clie
int32 quest_id = 0;
if(sep && sep->arg[0] && sep->IsNumber(0))
quest_id = atoul(sep->arg[0]);
if(quest_id > 0){
client->GetPlayer()->MPlayerQuests.readlock(__FUNCTION__, __LINE__);
if(lua_interface && client->GetPlayer()->player_quests.count(quest_id) > 0) {
Quest* quest = client->GetPlayer()->player_quests[quest_id];
client->GetPlayer()->MPlayerQuests.releasereadlock(__FUNCTION__, __LINE__);
if (quest && quest->CanDeleteQuest()) {
lua_interface->CallQuestFunction(quest, "Deleted", client->GetPlayer());
client->RemovePlayerQuest(quest_id);
client->GetCurrentZone()->SendQuestUpdates(client);
}
}
else {
client->GetPlayer()->MPlayerQuests.releasereadlock(__FUNCTION__, __LINE__);
}
client->DeleteQuest(quest_id);
}
break;
}

View File

@ -3901,7 +3901,6 @@ int EQ2Emu_lua_OfferQuest(lua_State* state) {
bool forced = lua_interface->GetBooleanValue(state, 4);
lua_interface->ResetFunctionStack(state);
/* NPC is allowed to be null */
if (player && player->IsPlayer() && quest_id > 0) {
Quest* master_quest = master_quest_list.GetQuest(quest_id, false);
if (master_quest) {
@ -3939,7 +3938,6 @@ int EQ2Emu_lua_DeleteQuest(lua_State* state) {
bool override_deny_delete = lua_interface->GetBooleanValue(state, 3);
lua_interface->ResetFunctionStack(state);
/* NPC is allowed to be null */
if (player && player->IsPlayer() && quest_id > 0) {
Client* client = ((Player*)player)->GetClient();
if (!client) {