Browse files

Added system messages confirming when items have been locked down or…

… released in a house

	Fixed a bug where targeting a non-valid object would crash UOX3 when trying to release locked down items
  • Loading branch information...
1 parent 13f0b2b commit d82bd0d67af522b17f9a339167717eef1d9b9809 xuridabur committed Jan 24, 2010
Showing with 26 additions and 13 deletions.
  1. +2 −0 source/Changelog.txt
  2. +24 −13 source/targeting.cpp
View
2 source/Changelog.txt
@@ -1,5 +1,7 @@
1/24/2010 - Xuri
Added definition of 0x1EB9 as a Tinker Tool in jse_objectassociations.scp
+ Added system messages confirming when items have been locked down or released in a house
+ Fixed a bug where targeting a non-valid object would crash UOX3 when trying to release locked down items
11/08/2009 - Xuri
Added support for LOOT and PACKITEM dfn tags in item-defintions, for pre-adding items to containers (Shudderz)
View
37 source/targeting.cpp
@@ -1236,7 +1236,10 @@ void HouseLockdown( CSocket *s ) // Abaddon
return;
}
if( multi->GetLockDownCount() < multi->GetMaxLockDowns() )
+ {
multi->LockDownItem( itemToLock );
+ s->sysmessage( 1786 );
+ }
else
s->sysmessage( "You have too many locked down items" );
return;
@@ -1257,25 +1260,33 @@ void HouseRelease( CSocket *s ) // Abaddon
VALIDATESOCKET( s );
CItem *itemToLock = calcItemObjFromSer( s->GetDWord( 7 ) );
- if( ValidateObject( itemToLock ) || !itemToLock->IsLockedDown() )
+ if( ValidateObject( itemToLock ) ) // || !itemToLock->IsLockedDown() )
{
- CMultiObj *house = static_cast<CMultiObj *>(s->TempObj()); // let's find our house
- s->TempObj( NULL );
- // time to lock it down!
- CMultiObj *multi = findMulti( itemToLock );
- if( ValidateObject( multi ) )
+ if( itemToLock->IsLockedDown() )
{
- if( multi != house )
+ CMultiObj *house = static_cast<CMultiObj *>(s->TempObj()); // let's find our house
+ s->TempObj( NULL );
+ // time to release it!
+ CMultiObj *multi = findMulti( itemToLock );
+ if( ValidateObject( multi ) )
{
- s->sysmessage( 1109 );
+ if( multi != house )
+ {
+ s->sysmessage( 1109 );
+ return;
+ }
+ if( multi->GetLockDownCount() > 0 )
+ {
+ multi->RemoveLockDown( itemToLock ); // Default as stored by the client, perhaps we should keep a backup?
+ s->sysmessage( 1787 );
+ }
return;
}
- if( multi->GetLockDownCount() > 0 )
- multi->RemoveLockDown( itemToLock ); // Default as stored by the client, perhaps we should keep a backup?
- return;
+ // not in a multi!
+ s->sysmessage( 1107 );
}
- // not in a multi!
- s->sysmessage( 1107 );
+ else
+ s->sysmessage( 1785 );
}
else
s->sysmessage( 1108 );

0 comments on commit d82bd0d

Please sign in to comment.