SphereServer BugTracker - SphereServer
View Issue Details
0001539SphereServerexecutable - genericpublic19-10-08 23:1526-10-08 15:07
XeroX 
MrSugarCube 
normalcrashalways
resolvedfixed 
 
20-09-2009, 0.56b Prerelease 
09-09-2008
None
None
0001539: Crash on Skillmenu Back function
We are trying to have a back function to the main menu of the skillmenu.

The result is the following on the screenshot with this script:




[skillmenu sm_alchemie_heilung]
Welcher Heiltrank?

//This is producing the crash
ON=i_testtube_rack_full Zurueck
skillmenu sm_alchemie

ON=i_potion_refreshtotal Schwache Heilung
makeitem=i_schwacher_heiltrank

ON=i_potion_refreshtotal Heiltrank
makeitem=i_heiltrank

ON=i_potion_refreshtotal Starker Heiltrank
makeitem=i_guter_heiltrank

No tags attached.
jpg skillmenucrash.JPG (223,093) 19-10-08 23:15
http://tracker.sphere.torfo.org/bugs/file_download.php?file_id=18&type=bug
Issue History
19-10-08 23:15XeroXNew Issue
19-10-08 23:15XeroXFile Added: skillmenucrash.JPG
19-10-08 23:15XeroXNightly Version => 09-09-2008
19-10-08 23:15XeroXExperimental Flags => None
19-10-08 23:15XeroXOption Flags => None
26-10-08 15:07MrSugarCubeStatusnew => resolved
26-10-08 15:07MrSugarCubeFixed in Version => 0.56c Nightly
26-10-08 15:07MrSugarCubeResolutionopen => fixed
26-10-08 15:07MrSugarCubeAssigned To => MrSugarCube
26-10-08 15:07MrSugarCubeNote Added: 0000120

Notes
(0000120)
MrSugarCube   
26-10-08 15:07   
Since Sphere scans through all the SkillMenus to determine what can and can't be displayed, trying to add a 'Back' option in this way is going to result in an infinite loop (as it will obviously be scanning the same set of menus over and over again).

I've fixed the crash that this causes (instead a console error will be shown), but it is probably best to avoid the loop completely by moving the "skillmenu sm_alchemie" call to a separate function (Sphere only scans under the 'ON=' line, not inside individual functions), for example:

// call a function to open the skillmenu, this way Sphere
// won't try to scan its items
ON=i_testtube_rack_full Zurueck
   fskillmenu sm_alchemie

// this function just opens a skillmenu
[FUNCTION fskillmenu]
SKILLMENU <ARGS>