Skip to content

Commit

Permalink
Fixes forecon marksman being hit by bullets while invisible (#8427)
Browse files Browse the repository at this point in the history
# About the pull request

Adds faction_marine to forecon preventing the marksman from being hit
while cloaked

# Explain why it's good for the game
fixes #7553 


# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>


# Changelog
:cl:
fix: Fixes forecon spotter/marksman being hit by ally bullets while
inivsible
/:cl:

---------

Co-authored-by: InsaneRed <prodexter31@outlook.comm>
Co-authored-by: harryob <55142896+harryob@users.noreply.github.com>
  • Loading branch information
3 people authored Feb 11, 2025
1 parent 5dc842b commit fc11ddd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
18 changes: 18 additions & 0 deletions code/modules/mob/mob_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,24 @@ GLOBAL_LIST_INIT(limb_types_by_name, list(
/mob/proc/can_see_reagents()
return stat == DEAD || issynth(src) || HAS_TRAIT(src, TRAIT_REAGENT_SCANNER) //Dead guys and synths can always see reagents

/// Returns TRUE if this mob is an ally of another, depending on the `faction` and `faction_group` variables, FALSE otherwise
/mob/proc/is_ally_of(mob/potential_ally)
. = FALSE

if(faction == potential_ally.faction)
return TRUE

if(faction in potential_ally.faction_group)
return TRUE

if(potential_ally.faction in faction_group)
return TRUE

if(length(faction_group & potential_ally.faction_group))
return TRUE

return FALSE

/**
* Examine a mob
*
Expand Down
2 changes: 1 addition & 1 deletion code/modules/projectiles/projectile.dm
Original file line number Diff line number Diff line change
Expand Up @@ -871,7 +871,7 @@
. -= mobility_aura * 5
var/mob/living/carbon/human/shooter_human = P.firer
if(istype(shooter_human))
if(shooter_human.faction == faction && !(ammo_flags & AMMO_ALWAYS_FF))
if(is_ally_of(shooter_human) && !(ammo_flags & AMMO_ALWAYS_FF))
. -= FF_hit_evade

if(ammo_flags & AMMO_MP)
Expand Down

0 comments on commit fc11ddd

Please sign in to comment.