wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 04-06-2011, 08:11 AM   #31
Bribe
User
 
Bribe's Avatar
 
Join Date: Mar 2010
Posts: 230

Submissions (1)

Bribe will become famous soon enough (26)

Send a message via AIM to Bribe
Default

You could use a GetItemIdSafe proxy-function which evaluates if the item is null, and your problem is solved.
Bribe is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 04-06-2011, 10:51 AM   #32
Anitarf
Procrastination Incarnate


Development Director
 
Join Date: Feb 2004
Posts: 8,080

Submissions (19)

Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)Anitarf has a brilliant future (888)

2008 Spell olympics - Fire - SilverApproved Map: Old School Alliance TacticsHero Contest #2 - 3rd PlaceSpell making session 2 winner

Default

Quote:
Originally Posted by SanKakU
i don't we're talking about the same thing. if one just selects all 6 itemslots and asks for itemindex numbers for each one of them, he will get relevant numbers for irrelevant itemslots. what's the point of that? that's why i added my if then part to getitemid.
That's exactly the same thing Bribe was talking about, as you quoted:
Quote:
Originally Posted by Bribe
The only thing I can see is somebody who doesn't know what they're doing calling GetItemId on a null item, in which case it's the user's responsibility to make sure they are passing a correct value (unless in debug-mode).
This is what you're doing. You are trying to get an id for null items (items from empty slots). You can simply avoid this by first checking if the slot is empty, or, as Bribe suggested, using a wrapper function.

However, adding a safety check directly to GetItemId shouldn't be a problem considering the function already isn't inline friendly. if(d==0) and (it!=null) then
__________________
Anitarf is offline   Reply With Quote
Old 04-08-2011, 03:09 AM   #33
SanKakU
User
 
Join Date: Jan 2009
Posts: 133

SanKakU has a little shameless behaviour in the past (-1)

Send a message via AIM to SanKakU Send a message via MSN to SanKakU Send a message via Yahoo to SanKakU
Default

Quote:
Originally Posted by Anitarf
That's exactly the same thing Bribe was talking about, as you quoted:

This is what you're doing. You are trying to get an id for null items (items from empty slots). You can simply avoid this by first checking if the slot is empty, or, as Bribe suggested, using a wrapper function.

However, adding a safety check directly to GetItemId shouldn't be a problem considering the function already isn't inline friendly. if(d==0) and (it!=null) then
maybe i don't remember things right but if i do...the following is true.

i was merely testing the system to see what does it do. i don't want the system indexing null items...whether i try to get an id for them or not. furthermore...the system IS indexing blank inventory slots without authorization from the user, or how else would you explain inappropriate index numbers for items that are picked up and you get the index numbers AFTER you pick up the items? if you check the inventory slots the numbers for items picked up remain the same regardless of whether you call for the index numbers before picking up items.

now i guess i better go check again.
SanKakU is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off


All times are GMT. The time now is 08:21 AM.


Donate

Affiliates
The Hubb http://bylur.com - Warcraft, StarCraft, Diablo and DotA Blog & Forums The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2014, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services