SphereServer BugTracker - SphereServer
View Issue Details
0002308SphereServernew feature requestpublic14-04-14 16:3617-04-14 21:07
wuffel 
Ben 
normalfeaturealways
closedno change required 
 
 
Not Available
None
None
0002308: itemdef0, chardef0, typedef0, etc.
i would like the possibility to check if a specific definition exists or not.
for example .show serv.itemdef.i_double works (returns 0) but also throws an error to the logfile.
show serv.itemdef.i_doublet instead works fine.
serv.itemdef0.i_double to handle those error-messages. Also to have this ability for all other definitions would be nice. :)
No tags attached.
Issue History
14-04-14 16:36wuffelNew Issue
14-04-14 16:49CorujaNote Added: 0002047
17-04-14 21:07BenNote Added: 0002053
17-04-14 21:07BenStatusnew => closed
17-04-14 21:07BenAssigned To => Ben
17-04-14 21:07BenResolutionopen => no change required

Notes
(0002047)
Coruja   
14-04-14 16:49   
I reported it some months ago too
to prevent console error you need to use DEF to check if the item exists

IF (<DEF0.i_doublet>) || (<DEF0.c_man>) || (<DEF0.t_normal>)
  ...
ENDIF

this can prevent console errors on scripts, but can't prevent when some GM try to add manually an itemdef that doesn't exist (using '.add i_something')
(0002053)
Ben   
17-04-14 21:07   
The problem with this is that the error comes from not being able to resolve the defname to an internal value.
Like Coruja mentioned, use DEF0.<value> to check if that defname exists, there is no point in adding itemdef0, chardef0, typedef0, and more to do exactly what DEF0 already does.