Skip to content

Commit

Permalink
remove a goto
Browse files Browse the repository at this point in the history
OpenDream doesn't properly recognize some local vars when using gotos and labels
  • Loading branch information
pali6 committed Apr 18, 2023
1 parent cbec237 commit 36c3653
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions code/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2320,27 +2320,25 @@

sortList(OL, /proc/cmp_text_asc)

selection:
var/IP = input(output_target, "Select item to view fingerprints, cancel to close window.", "[src]'s inventory") as null|anything in OL
while(TRUE)
var/IP = input(output_target, "Select item to view fingerprints, cancel to close window.", "[src]'s inventory") as null|anything in OL

if (!IP || !output_target || !ismob(output_target))
return
if (!IP || !output_target || !ismob(output_target))
return

if (!src || !ismob(src))
output_target.show_text("Target mob doesn't exist anymore.", "red")
return
if (!src || !ismob(src))
output_target.show_text("Target mob doesn't exist anymore.", "red")
return

if (IP == REFRESH)
src.print_contents(output_target)
return
if (IP == REFRESH)
src.print_contents(output_target)
return

if (isnull(OL[IP]) || !isobj(OL[IP]))
output_target.show_text("Selected object reference is invalid (item deleted?). Try freshing the list.", "red")
goto selection
if (isnull(OL[IP]) || !isobj(OL[IP]))
output_target.show_text("Selected object reference is invalid (item deleted?). Try freshing the list.", "red")

if (output_target.client)
output_target.client.view_fingerprints(OL[IP])
goto selection
if (output_target.client)
output_target.client.view_fingerprints(OL[IP])

return
#undef REFRESH
Expand Down

0 comments on commit 36c3653

Please sign in to comment.