Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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...
commit d82bd0d67af522b17f9a339167717eef1d9b9809 1 parent 13f0b2b
xuridabur authored

Showing 2 changed files with 26 additions and 13 deletions. Show diff stats Hide diff stats

  1. +2 0  source/Changelog.txt
  2. +24 13 source/targeting.cpp
2  source/Changelog.txt
... ... @@ -1,5 +1,7 @@
1 1 1/24/2010 - Xuri
2 2 Added definition of 0x1EB9 as a Tinker Tool in jse_objectassociations.scp
  3 + Added system messages confirming when items have been locked down or released in a house
  4 + Fixed a bug where targeting a non-valid object would crash UOX3 when trying to release locked down items
3 5
4 6 11/08/2009 - Xuri
5 7 Added support for LOOT and PACKITEM dfn tags in item-defintions, for pre-adding items to containers (Shudderz)
37 source/targeting.cpp
@@ -1236,7 +1236,10 @@ void HouseLockdown( CSocket *s ) // Abaddon
1236 1236 return;
1237 1237 }
1238 1238 if( multi->GetLockDownCount() < multi->GetMaxLockDowns() )
  1239 + {
1239 1240 multi->LockDownItem( itemToLock );
  1241 + s->sysmessage( 1786 );
  1242 + }
1240 1243 else
1241 1244 s->sysmessage( "You have too many locked down items" );
1242 1245 return;
@@ -1257,25 +1260,33 @@ void HouseRelease( CSocket *s ) // Abaddon
1257 1260 VALIDATESOCKET( s );
1258 1261 CItem *itemToLock = calcItemObjFromSer( s->GetDWord( 7 ) );
1259 1262
1260   - if( ValidateObject( itemToLock ) || !itemToLock->IsLockedDown() )
  1263 + if( ValidateObject( itemToLock ) ) // || !itemToLock->IsLockedDown() )
1261 1264 {
1262   - CMultiObj *house = static_cast<CMultiObj *>(s->TempObj()); // let's find our house
1263   - s->TempObj( NULL );
1264   - // time to lock it down!
1265   - CMultiObj *multi = findMulti( itemToLock );
1266   - if( ValidateObject( multi ) )
  1265 + if( itemToLock->IsLockedDown() )
1267 1266 {
1268   - if( multi != house )
  1267 + CMultiObj *house = static_cast<CMultiObj *>(s->TempObj()); // let's find our house
  1268 + s->TempObj( NULL );
  1269 + // time to release it!
  1270 + CMultiObj *multi = findMulti( itemToLock );
  1271 + if( ValidateObject( multi ) )
1269 1272 {
1270   - s->sysmessage( 1109 );
  1273 + if( multi != house )
  1274 + {
  1275 + s->sysmessage( 1109 );
  1276 + return;
  1277 + }
  1278 + if( multi->GetLockDownCount() > 0 )
  1279 + {
  1280 + multi->RemoveLockDown( itemToLock ); // Default as stored by the client, perhaps we should keep a backup?
  1281 + s->sysmessage( 1787 );
  1282 + }
1271 1283 return;
1272 1284 }
1273   - if( multi->GetLockDownCount() > 0 )
1274   - multi->RemoveLockDown( itemToLock ); // Default as stored by the client, perhaps we should keep a backup?
1275   - return;
  1285 + // not in a multi!
  1286 + s->sysmessage( 1107 );
1276 1287 }
1277   - // not in a multi!
1278   - s->sysmessage( 1107 );
  1288 + else
  1289 + s->sysmessage( 1785 );
1279 1290 }
1280 1291 else
1281 1292 s->sysmessage( 1108 );

0 comments on commit d82bd0d

Please sign in to comment.
Something went wrong with that request. Please try again.