Fixes bug allowing player to multiclick WG

This commit is contained in:
ZomgPonies
2015-11-14 10:55:56 -05:00
parent dfde703d50
commit 59edd0f0d8
+11 -2
View File
@@ -9,6 +9,7 @@
density = 1
var/datum/mind/target
var/list/types = list()
var/inuse = 0
/obj/machinery/wish_granter/New()
for(var/supname in all_superheroes)
@@ -24,22 +25,30 @@
else if(is_special_character(user))
user << "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away."
return
else if(inuse)
user << "Someone is already communing with the Wish Granter."
return
else
user << "The power of the Wish Granter have turned you into the superhero the station deserves. You are a masked vigilante, and answer to no man. Will you use your newfound strength to protect the innocent, or will you hunt the guilty?"
inuse = 1
var/wish
if(types.len == 1)
wish = pick(types)
else
wish = input("You want to become...","Wish") as null|anything in types
if(!wish) return
if(!wish)
inuse=0
return
types -= wish
var/mob/living/carbon/human/M = user
var/datum/superheroes/S = all_superheroes[wish]
if(S)
S.create(M)
inuse=0
//Remove the wishgranter or teleport it randomly on the station
if(!types.len)