Skip to content

Commit

Permalink
Fix #1115
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhobean authored Oct 1, 2023
1 parent 904155a commit 62167fc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 28 deletions.
16 changes: 8 additions & 8 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3016,7 +3016,6 @@ Note: The only way the server has to know if the bankself is closed is to store
- Changed: @UserQuestArrowClick, using return 1 now prevents from showing default message when (left/right)clicking arrow.
- Changed: Crafting skills now won't display the bounce message when successfully crafting an item, with the skill message is enough.


10-08-2022, Drk84
- Added: PROMPT_CLILOC for Skill Definition. This allow you to set a cliloc number in the aforementioned property and it will be used instead of the PROMPT_MSG text.
Example:
Expand Down Expand Up @@ -3335,19 +3334,20 @@ Additionally, the problem of zig-zag issue following in the South direction has
- Added: CMake Clang compilation toolchains for Windows, Linux, MacOS.

13-09-2023, Drk84
-Fixed: Sphere.ini setting ManaLossPercent not consuming mana unless set to 100. (Issue #1096)
- Fixed: Sphere.ini setting ManaLossPercent not consuming mana unless set to 100. (Issue #1096)
Remember that the mana lost depends from the spell Mana base cost and eventually the LowerManaCost property if set.

14-09-2023, Drk84
-Fixed: Using ATTACKER.TARGET on a fighting NPC will return always -1. (Issue #1098)
- Fixed: Using ATTACKER.TARGET on a fighting NPC will return always -1. (Issue #1098)

15-09-2023, Drk84
Fixed: Ship plank not remaining open when turning the ship around. ( Issue #1089)
- Fixed: Ship plank not remaining open when turning the ship around. ( Issue #1089)
The ship plank will now autoclose after 5 seconds.
Fixed: Client Linger Timer is 3600 seconds on stoned players. (Issue #1081)
- Fixed: Client Linger Timer is 3600 seconds on stoned players. (Issue #1081)

23-09-2023, Jhobean
Fixed: When deleting account, f_onchar_delete was not call on char and char's item was not remove causing warning on next server boot. ( Issue #1029)
23-09-2023 / 27-09-27 (2 commits), Jhobean
- Fixed: When deleting account, f_onchar_delete was not call on char and char's item was not remove causing warning on next server boot. ( Issue #1029)
- Changed: Optimisation how f_onchar_delete is launch and avoid dual launch when delete char on login screen.

26-09-2023, Drk84
Fixed: Ship plank disappearing when closed before its timer expires or after a save is performed.
- Fixed: Ship plank disappearing when closed before its timer expires or after a save is performed.
14 changes: 8 additions & 6 deletions src/game/chars/CChar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -397,18 +397,20 @@ bool CChar::NotifyDelete(bool fForce)
if (IsTrigUsed(TRIGGER_DESTROY))
{
//We can forbid the deletion in here with no pain
if (CChar::OnTrigger(CTRIG_Destroy, &g_Serv) == TRIGRET_RET_TRUE && !fForce) //If NotifyDelete is forced, it's imposible to reverse the deletion
//If Delete is forced, we must avoid the possibility to block deletion (will create infinite loop)
if (CChar::OnTrigger(CTRIG_Destroy, &g_Serv) == TRIGRET_RET_TRUE && !fForce)
return false;
}

// If this is a player, check for f_onchar_delete
if (m_pClient || fForce)
if (m_pPlayer)
{
TRIGRET_TYPE trigReturn;
CScriptTriggerArgs Args;
Args.m_pO1 = m_pClient;
if (m_pClient)
Args.m_pO1 = m_pClient;
r_Call("f_onchar_delete", this, &Args, nullptr, &trigReturn);
//If NotifyDelete is forced, we must avoid the possibility to block deletion (will create infinite loop)
//If Delete is forced, we must avoid the possibility to block deletion (will create infinite loop)
if (trigReturn == TRIGRET_RET_TRUE && !fForce)
return false;
}
Expand Down Expand Up @@ -444,7 +446,7 @@ bool CChar::Delete(bool fForce)
}

DeleteCleanup(fForce); // not virtual

if (m_pPlayer && fForce)
ClearPlayer();

Expand Down Expand Up @@ -571,7 +573,7 @@ void CChar::ClearPlayer()
{
if (g_Serv.GetServerMode() != SERVMODE_Exiting)
{
g_Log.EventWarn("Player delete '%s' name from account '%s'.\n", GetName(), pAccount->GetName());
g_Log.EventWarn("Character '%s'(UID 0%x) on account '%s' as been deleted.\n", GetName(), (dword)GetUID(), pAccount->GetName());
}

pAccount->DetachChar(this); // unlink me from my account.
Expand Down
27 changes: 13 additions & 14 deletions src/game/clients/CClientMsg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2847,23 +2847,22 @@ byte CClient::Setup_Delete( dword iSlot ) // Deletion of character
}
}

// Do the scripts allow to delete the char?
enum TRIGRET_TYPE tr;
CScriptTriggerArgs Args;
Args.m_pO1 = this;
pChar->r_Call("f_onchar_delete", pChar, &Args, nullptr, &tr);
if ( tr == TRIGRET_RET_TRUE )


if (pChar->Delete()) // Do the scripts allow to delete the char?
{
g_Log.Event(LOGM_ACCOUNTS|LOGL_EVENT, "Character delete request on client login screen.\n");

pChar->ClearPlayer();
// refill the list.
new PacketCharacterListUpdate(this, GetAccount()->m_uidLastChar.CharFind());
return PacketDeleteError::Success;
}
else
{
return PacketDeleteError::InvalidRequest;
}

g_Log.Event(LOGM_ACCOUNTS|LOGL_EVENT, "%x:Account '%s' deleted char '%s' [0%x] on client login screen.\n", GetSocketID(), GetAccount()->GetName(), pChar->GetName(), (dword)(pChar->GetUID()));
pChar->Delete(true);

// refill the list.
new PacketCharacterListUpdate(this, GetAccount()->m_uidLastChar.CharFind());

return PacketDeleteError::Success;

}

byte CClient::Setup_ListReq( const char * pszAccName, const char * pszPassword, bool fTest )
Expand Down

0 comments on commit 62167fc

Please sign in to comment.