Skip to content

Commit

Permalink
Fixed: Ship plank disappearing when closed before its timer expires o…
Browse files Browse the repository at this point in the history
…r after a save is performed.
  • Loading branch information
drk84 committed Sep 26, 2023
1 parent 4e46531 commit b82a65a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 3 additions & 0 deletions Changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3348,3 +3348,6 @@ 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)

26-09-2023, Drk84
Fixed: Ship plank disappearing when closed before its timer expires or after a save is performed.
14 changes: 10 additions & 4 deletions src/game/items/CItemShip.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,16 +53,22 @@ bool CItem::Ship_Plank(bool fOpen)
{
// Save the original Type of the plank if it used to be a ship side
m_itShipPlank.m_wSideType = (word)oldType;

SetTimeoutS(5); // autoclose the plank
SetAttr(ATTR_DECAY); // For preventing Decay Warning on the console.
if ( !IsTimerSet() )
{
SetTimeoutS(5); // autoclose the plank
SetAttr(ATTR_DECAY); // For preventing Decay Warning on the console.
}
}
else if (oldType == IT_SHIP_PLANK)
{
// Restore the type of the ship side
if (m_itShipPlank.m_wSideType == IT_SHIP_SIDE || m_itShipPlank.m_wSideType == IT_SHIP_SIDE_LOCKED)
{
SetType((IT_TYPE)(m_itShipPlank.m_wSideType));

if (IsTimerSet())
ClearTimeout(); //We clear the timer otherwise the plank item will be removed if it is closed before the timer expires.
ClrAttr(ATTR_DECAY); //We remove the ATTR_DECAY flag or the plank will disappear on next save.
}
m_itShipPlank.m_wSideType = IT_NORMAL;
}

Expand Down

0 comments on commit b82a65a

Please sign in to comment.