SphereServer BugTracker - SphereServer
View Issue Details
0002567SphereServerexecutable - windows buildpublic26-12-15 15:3327-12-15 02:15
xwerswoodx 
Coruja 
normalmajoralways
closedno change required 
16-06-2013, 0.56b Prerelease 
 
Automated (specify build number)
None
None
0002567: FINDCONT not working for weapons if there is any other item
When I try to auto looting corpse it isn't working for weapons (maybe armors I didn't try). The problem is if there is any item FINDCONT not working for weapon.

[Function sharelootpack]
REF11=<ARGS>
for X 0 <eval <REF11.RESCOUNT> - 1>
  REF12=<REF11.FINDCONT.<DLOCAL.X>.UID>
  serv.log PACKID: <REF11> ITEMCOUNT: <REF11.RESCOUNT> FINDCONT: <DLOCAL.X> PACKNAME: <REF11.NAME> ITEMNAME: <REF12.NAME>
  if <REF12>
    shareloot <REF12>
  endif
endfor

This is the code and this is the output

Trying first time to loot:
14:31:(functions.scp,63)PACKID: 040004079 ITEMCOUNT: 3 FINDCONT: 0 PACKNAME: a corpse of Zorhgigoth ITEMNAME: gold coin
14:31:(functions.scp,63)PACKID: 040004079 ITEMCOUNT: 2 FINDCONT: 1 PACKNAME: a corpse of Zorhgigoth ITEMNAME: Upgrade Scroll
14:31:(functions.scp,63)PACKID: 040004079 ITEMCOUNT: 1 FINDCONT: 2 PACKNAME: a corpse of Zorhgigoth ITEMNAME: 0

You can see here 3rd item which is i_katana is "0"

This is the second time to try:
14:31:(functions.scp,63)PACKID: 040004079 ITEMCOUNT: 1 FINDCONT: 0 PACKNAME: a corpse of Zorhgigoth ITEMNAME: katana

Here you can see it shows katana's name.
No tags attached.
Issue History
26-12-15 15:33xwerswoodxNew Issue
26-12-15 15:58xwerswoodxNote Added: 0003000
26-12-15 16:03xwerswoodxNote Deleted: 0003000
26-12-15 16:03xwerswoodxIssue Monitored: xwerswoodx
26-12-15 16:06xwerswoodxNote Added: 0003001
27-12-15 02:15CorujaNote Added: 0003002
27-12-15 02:15CorujaStatusnew => closed
27-12-15 02:15CorujaAssigned To => Coruja
27-12-15 02:15CorujaResolutionopen => no change required

Notes
(0003001)
xwerswoodx   
26-12-15 16:06   
I solved the problem, I though it was bug but it was only my mistake, sorry for spam, you can remove issue, sorry again.
(0003002)
Coruja   
27-12-15 02:15   
yep that's just your FOR order, you can't call FINDCONT.3 in an container that only have items 0/1/2

to avoid this you can just reverse your FOR using
FOR <eval <RESCOUNT>-1> 0
instead of
FOR 0 <eval <RESCOUNT>-1>