Ports some in operator misuse bugfixes.

This commit is contained in:
Ghommie
2019-10-15 00:26:13 +02:00
parent 304eae3407
commit 0cb433ba99
4 changed files with 7 additions and 7 deletions

View File

@@ -206,7 +206,7 @@
switch(action) switch(action)
if("vote") if("vote")
var/selected_answer = params["answer"] var/selected_answer = params["answer"]
if(!selected_answer in possible_answers) if(!(selected_answer in possible_answers))
return return
else else
votes[user.ckey] = selected_answer votes[user.ckey] = selected_answer

View File

@@ -122,7 +122,7 @@
if(user.mob_size <= MOB_SIZE_SMALL) if(user.mob_size <= MOB_SIZE_SMALL)
to_chat(user, "<span class='notice'>You poke a limb through [src]'s bars and start fumbling for the lock switch... (This will take some time.)</span>") to_chat(user, "<span class='notice'>You poke a limb through [src]'s bars and start fumbling for the lock switch... (This will take some time.)</span>")
to_chat(loc, "<span class='warning'>You see [user] reach through the bars and fumble for the lock switch!</span>") to_chat(loc, "<span class='warning'>You see [user] reach through the bars and fumble for the lock switch!</span>")
if(!do_after(user, rand(300, 400), target = user) || open || !locked || !user in occupants) if(!do_after(user, rand(300, 400), target = user) || open || !locked || !(user in occupants))
return return
loc.visible_message("<span class='warning'>[user] flips the lock switch on [src] by reaching through!</span>", null, null, null, user) loc.visible_message("<span class='warning'>[user] flips the lock switch on [src] by reaching through!</span>", null, null, null, user)
to_chat(user, "<span class='boldannounce'>Bingo! The lock pops open!</span>") to_chat(user, "<span class='boldannounce'>Bingo! The lock pops open!</span>")
@@ -132,7 +132,7 @@
else else
loc.visible_message("<span class='warning'>[src] starts rattling as something pushes against the door!</span>", null, null, null, user) loc.visible_message("<span class='warning'>[src] starts rattling as something pushes against the door!</span>", null, null, null, user)
to_chat(user, "<span class='notice'>You start pushing out of [src]... (This will take about 20 seconds.)</span>") to_chat(user, "<span class='notice'>You start pushing out of [src]... (This will take about 20 seconds.)</span>")
if(!do_after(user, 200, target = user) || open || !locked || !user in occupants) if(!do_after(user, 200, target = user) || open || !locked || !(user in occupants))
return return
loc.visible_message("<span class='warning'>[user] shoves out of [src]!</span>", null, null, null, user) loc.visible_message("<span class='warning'>[user] shoves out of [src]!</span>", null, null, null, user)
to_chat(user, "<span class='notice'>You shove open [src]'s door against the lock's resistance and fall out!</span>") to_chat(user, "<span class='notice'>You shove open [src]'s door against the lock's resistance and fall out!</span>")
@@ -185,7 +185,7 @@
occupant_weight += occupant.mob_size occupant_weight += occupant.mob_size
/obj/item/pet_carrier/proc/remove_occupant(mob/living/occupant, turf/new_turf) /obj/item/pet_carrier/proc/remove_occupant(mob/living/occupant, turf/new_turf)
if(!occupant in occupants || !istype(occupant)) if(!(occupant in occupants) || !istype(occupant))
return return
occupant.forceMove(new_turf ? new_turf : drop_location()) occupant.forceMove(new_turf ? new_turf : drop_location())
occupants -= occupant occupants -= occupant

View File

@@ -534,7 +534,7 @@ GLOBAL_PROTECT(VVpixelmovement)
if (prompt != "Continue") if (prompt != "Continue")
return FALSE return FALSE
return TRUE return TRUE
/client/proc/modify_variables(atom/O, param_var_name = null, autodetect_class = 0) /client/proc/modify_variables(atom/O, param_var_name = null, autodetect_class = 0)
if(!check_rights(R_VAREDIT)) if(!check_rights(R_VAREDIT))
@@ -545,7 +545,7 @@ GLOBAL_PROTECT(VVpixelmovement)
var/var_value var/var_value
if(param_var_name) if(param_var_name)
if(!param_var_name in O.vars) if(!(param_var_name in O.vars))
to_chat(src, "A variable with this name ([param_var_name]) doesn't exist in this datum ([O])") to_chat(src, "A variable with this name ([param_var_name]) doesn't exist in this datum ([O])")
return return
variable = param_var_name variable = param_var_name

View File

@@ -78,7 +78,7 @@
return return
voters += user.key voters += user.key
else else
if(!user.key in voters) if(!(user.key in voters))
return return
voters -= user.key voters -= user.key
var/votes_left = votes_needed - voters.len var/votes_left = votes_needed - voters.len