mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-11 18:22:14 +00:00
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:
@@ -343,3 +343,9 @@
|
|||||||
if(D.vars.Find(varname))
|
if(D.vars.Find(varname))
|
||||||
if(D.vars[varname] == value)
|
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
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
/datum/round_event/brand_intelligence
|
/datum/round_event/brand_intelligence
|
||||||
announceWhen = 21
|
announceWhen = 21
|
||||||
endWhen = 1000 //Ends when all vending machines are subverted anyway.
|
endWhen = 1000 //Ends when all vending machines are subverted anyway.
|
||||||
|
|
||||||
var/list/obj/machinery/vending/vendingMachines = list()
|
var/list/obj/machinery/vending/vendingMachines = list()
|
||||||
var/list/obj/machinery/vending/infectedMachines = list()
|
var/list/obj/machinery/vending/infectedMachines = list()
|
||||||
var/obj/machinery/vending/originMachine
|
var/obj/machinery/vending/originMachine
|
||||||
@@ -28,11 +27,9 @@
|
|||||||
for(var/obj/machinery/vending/V in machines)
|
for(var/obj/machinery/vending/V in machines)
|
||||||
if(V.z != 1) continue
|
if(V.z != 1) continue
|
||||||
vendingMachines.Add(V)
|
vendingMachines.Add(V)
|
||||||
|
|
||||||
if(!vendingMachines.len)
|
if(!vendingMachines.len)
|
||||||
kill()
|
kill()
|
||||||
return
|
return
|
||||||
|
|
||||||
originMachine = pick(vendingMachines)
|
originMachine = pick(vendingMachines)
|
||||||
vendingMachines.Remove(originMachine)
|
vendingMachines.Remove(originMachine)
|
||||||
originMachine.shut_up = 0
|
originMachine.shut_up = 0
|
||||||
@@ -48,7 +45,7 @@
|
|||||||
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
|
originMachine.visible_message("[originMachine] beeps and seems lifeless.")
|
||||||
kill()
|
kill()
|
||||||
return
|
return
|
||||||
|
vendingMachines = removeNullsFromList(vendingMachines)
|
||||||
if(!vendingMachines.len) //if every machine is infected
|
if(!vendingMachines.len) //if every machine is infected
|
||||||
for(var/obj/machinery/vending/upriser in infectedMachines)
|
for(var/obj/machinery/vending/upriser in infectedMachines)
|
||||||
if(prob(70) && !upriser.gc_destroyed)
|
if(prob(70) && !upriser.gc_destroyed)
|
||||||
@@ -62,7 +59,6 @@
|
|||||||
|
|
||||||
kill()
|
kill()
|
||||||
return
|
return
|
||||||
|
|
||||||
if(IsMultiple(activeFor, 4))
|
if(IsMultiple(activeFor, 4))
|
||||||
var/obj/machinery/vending/rebel = pick(vendingMachines)
|
var/obj/machinery/vending/rebel = pick(vendingMachines)
|
||||||
vendingMachines.Remove(rebel)
|
vendingMachines.Remove(rebel)
|
||||||
|
|||||||
Reference in New Issue
Block a user