Revision: 808
http://sourceforge.net/p/polserver/code/808
Author: rozenblit
Date: 2014-06-09 22:44:44 +0000 (Mon, 09 Jun 2014)
Log Message:
-----------
Checking item layer when removing from corpse.
Modified Paths:
--------------
trunk/pol-core/pol/containr.h
Modified: trunk/pol-core/pol/containr.h
===================================================================
--- trunk/pol-core/pol/containr.h 2014-06-09 21:25:03 UTC (rev 807)
+++ trunk/pol-core/pol/containr.h 2014-06-09 22:44:44 UTC (rev 808)
@@ -254,7 +254,11 @@
inline Items::Item *UCorpse::GetItemOnLayer( unsigned idx ) const
{
- return ITEM_ELEM_PTR( layer_list_[idx] );
+ // Checks if the requested layer is valid
+ if (idx >= LAYER_INFO::LAYER_EQUIP__LOWEST && idx <= LAYER_INFO::LAYER_EQUIP__HIGHEST)
+ return ITEM_ELEM_PTR( layer_list_[idx] );
+
+ return EMPTY_ELEM;
}
class WornItemsContainer : public UContainer
@@ -289,7 +293,11 @@
inline Items::Item *WornItemsContainer::GetItemOnLayer( unsigned idx ) const
{
- return ITEM_ELEM_PTR( contents_[idx] );
+ // Checks if the requested layer is valid
+ if (idx >= LAYER_INFO::LAYER_EQUIP__LOWEST && idx <= LAYER_INFO::LAYER_EQUIP__HIGHEST)
+ return ITEM_ELEM_PTR( contents_[idx] );
+
+ return NULL;
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|