Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed: Ship plank disappearing when closed before its timer expires or after a save is performed. #1111

Merged
merged 1 commit into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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