Fixes the brand intelligence event not triggering the uprising under certain conditions.

Adds a new proc for the list helpers, removeNullsFromList() It does what it says.
This commit is contained in:
Aranclanos
2015-08-24 07:52:54 -03:00
parent d8b703c974
commit 20ba3071ed
2 changed files with 8 additions and 6 deletions

View File

@@ -342,4 +342,10 @@
for(var/datum/D in L)
if(D.vars.Find(varname))
if(D.vars[varname] == value)
return D
return D
//remove all nulls from a list
/proc/removeNullsFromList(list/L)
while(L.Remove(null))
continue
return L

View File

@@ -7,7 +7,6 @@
/datum/round_event/brand_intelligence
announceWhen = 21
endWhen = 1000 //Ends when all vending machines are subverted anyway.
var/list/obj/machinery/vending/vendingMachines = list()
var/list/obj/machinery/vending/infectedMachines = list()
var/obj/machinery/vending/originMachine
@@ -28,11 +27,9 @@
for(var/obj/machinery/vending/V in machines)
if(V.z != 1) continue
vendingMachines.Add(V)
if(!vendingMachines.len)
kill()
return
originMachine = pick(vendingMachines)
vendingMachines.Remove(originMachine)
originMachine.shut_up = 0
@@ -48,7 +45,7 @@
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
kill()
return
vendingMachines = removeNullsFromList(vendingMachines)
if(!vendingMachines.len) //if every machine is infected
for(var/obj/machinery/vending/upriser in infectedMachines)
if(prob(70) && !upriser.gc_destroyed)
@@ -62,7 +59,6 @@
kill()
return
if(IsMultiple(activeFor, 4))
var/obj/machinery/vending/rebel = pick(vendingMachines)
vendingMachines.Remove(rebel)