Skip to content

Commit

Permalink
Fixes invisibility exploit (tgstation#79337)
Browse files Browse the repository at this point in the history
## About The Pull Request
Adds a short cooldown timer (1s) to the toggle seethrough ability to
give it time to stop animating
## Why It's Good For The Game
Fixes tgstation#79161 
## Changelog
:cl:
fix: Fixed an invisibility exploit on large mobs. Probably better this
way
/:cl:

---------

Co-authored-by: Jacquerel <[email protected]>
  • Loading branch information
jlsnow301 and Jacquerel authored Oct 30, 2023
1 parent 692d38f commit cf1a7c8
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions code/datums/components/seethrough_mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

render_source_atom.render_source = "*transparent_bigmob[personal_uid]"

var/datum/action/toggle_seethrough/action = new(src)
var/datum/action/cooldown/toggle_seethrough/action = new(src)
action.Grant(parent)

/datum/component/seethrough_mob/Destroy(force, silent)
Expand Down Expand Up @@ -114,22 +114,22 @@
else
untrick_mob()

/datum/action/toggle_seethrough
/datum/action/cooldown/toggle_seethrough
name = "Toggle Seethrough"
desc = "Allows you to see behind your massive body and click through it."
button_icon = 'icons/mob/actions/actions_xeno.dmi'
button_icon_state = "alien_sneak"
background_icon_state = "bg_alien"
cooldown_time = 1 SECONDS
melee_cooldown_time = 0

/datum/action/toggle_seethrough/Remove(mob/remove_from)
var/datum/component/seethrough_mob/seethroughComp = target
if(seethroughComp.is_active)
seethroughComp.untrick_mob()
/datum/action/cooldown/toggle_seethrough/Remove(mob/remove_from)
var/datum/component/seethrough_mob/transparency = target
if(transparency.is_active)
transparency.untrick_mob()
return ..()

/datum/action/toggle_seethrough/Trigger(trigger_flags)
. = ..()
if(!.)
return
var/datum/component/seethrough_mob/seethroughComp = target
seethroughComp.toggle_active()
/datum/action/cooldown/toggle_seethrough/Activate(atom/t)
StartCooldown()
var/datum/component/seethrough_mob/transparency = target
transparency.toggle_active()

0 comments on commit cf1a7c8

Please sign in to comment.