Skip to content

Commit

Permalink
bugfix: immortal blob fix (#5482)
Browse files Browse the repository at this point in the history
* bugfix: immortal blob fix

* remove unnecessary ?

* qdel checks
  • Loading branch information
dageavtobusnick authored Jul 17, 2024
1 parent 11ab4a8 commit c5abbbf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions code/game/gamemodes/blob/blobs/core.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
if(overmind)
overmind.blob_core = null
overmind = null
SSticker.mode.blob_died()
SSticker?.mode?.blob_died()
STOP_PROCESSING(SSobj, src)
GLOB.poi_list.Remove(src)
return ..()
Expand Down Expand Up @@ -150,5 +150,5 @@
if(overmind.blob_reagent_datum)
overmind_datum.reagent = overmind.blob_reagent_datum
overmind.mind.add_antag_datum(overmind_datum)
color = overmind.blob_reagent_datum.color
color = overmind.blob_reagent_datum?.color

2 changes: 1 addition & 1 deletion code/game/gamemodes/blob/blobs/factory.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@
spore_delay = world.time + 100 // 10 seconds
var/mob/living/simple_animal/hostile/blob/blobspore/BS = new/mob/living/simple_animal/hostile/blob/blobspore(src.loc, src)
if(overmind)
BS.color = overmind.blob_reagent_datum?.complementary_color
BS.color = overmind?.blob_reagent_datum?.complementary_color
BS.overmind = overmind
overmind.blob_mobs.Add(BS)
2 changes: 1 addition & 1 deletion code/game/gamemodes/blob/blobs/node.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
/obj/structure/blob/node/Life(seconds, times_fired)
if(overmind)
for(var/i = 1; i < 8; i += i)
Pulse(5, i, overmind.blob_reagent_datum.color)
Pulse(5, i, overmind.blob_reagent_datum?.color)
else
for(var/i = 1; i < 8; i += i)
Pulse(5, i, color)
Expand Down
8 changes: 5 additions & 3 deletions code/game/gamemodes/blob/theblob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,13 @@
if(damage_flag)
armor_protection = armor.getRating(damage_flag)
damage_amount = round(damage_amount * (100 - armor_protection)*0.01, 0.1)
if(overmind && damage_flag)
if(overmind?.blob_reagent_datum && damage_flag)
damage_amount = overmind.blob_reagent_datum.damage_reaction(src, damage_amount, damage_type, damage_flag)
return damage_amount

/obj/structure/blob/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
if(QDELETED(src))
return
. = ..()
if(. && obj_integrity > 0)
check_integrity()
Expand All @@ -234,13 +236,13 @@

/obj/structure/blob/proc/get_chem_name()
for(var/mob/camera/blob/B in GLOB.mob_list)
if(lowertext(B.blob_reagent_datum.color) == lowertext(src.color)) // Goddamit why we use strings for these
if(!QDELETED(B) && lowertext(B.blob_reagent_datum.color) == lowertext(src.color)) // Goddamit why we use strings for these
return B.blob_reagent_datum.name
return "unknown"

/obj/structure/blob/proc/get_chem_desc()
for(var/mob/camera/blob/B in GLOB.mob_list)
if(lowertext(B.blob_reagent_datum.color) == lowertext(src.color)) // Goddamit why we use strings for these
if(!QDELETED(B) && lowertext(B.blob_reagent_datum.color) == lowertext(src.color)) // Goddamit why we use strings for these
return B.blob_reagent_datum.description
return "something unknown"

Expand Down
3 changes: 2 additions & 1 deletion code/modules/antagonists/blob/blob_overmind_datum.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

/datum/antagonist/blob_overmind/on_gain()
if(!reagent)
reagent = pick(subtypesof(/datum/reagent/blob))
var/reagent_type = pick(subtypesof(/datum/reagent/blob))
reagent = new reagent_type
return ..()

/datum/antagonist/blob_overmind/add_owner_to_gamemode()
Expand Down

0 comments on commit c5abbbf

Please sign in to comment.