Barthap
Member
|
INFO: World object containers (memc[] out of range)
If you use world object container (Items - OBJ_ITEM, Chrs - OBJ_CHR), use
Code:
if(Container_name.elms())
, because you can have 'memc[] out of range' error.
|
|
06-22-2010 01:53 PM |
|
Zervox
Member
|
RE: INFO: World object containers (memc[] out of range)
Just to add for some used example. Because I was having a problem with out of range with a few functions. (Thanks Esenthel and Barthap for wanting to help others with this)
instead of
Code:
Chr &plr=Players[0];
// Player &plr=Players[0]; in some cases better to limit what should be affected
if(Players.elms())
{
//Code here
}
Use something like this
->
Code:
if(Players.elms())
{
Chr &plr=Players[0]; // Player &plr=Players[0];
// Player &plr=Players[0]; in some cases better to limit what should be affected
//Code here
}
(This post was last modified: 06-22-2010 03:01 PM by Zervox.)
|
|
06-22-2010 02:57 PM |
|