-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix advanced proximity monitors being 1 tile too small (again...) (#8…
…4307) (#2455) Fixes #84301 Right here, https://github.com/tgstation/tgstation/blob/d1051ec8a80b34ca3f3cab2a14e75421e3bae3d6/code/datums/proximity_monitor/field.dm#L129-L132 We get the inner turfs and then use them to find the outer turfs But We subtract the inner turfs from the outer turfs instead of subtracting the outer turfs from the inner turfs... (also adds a unit test and updates the field debugger for better field debugging) :cl: Melbert fix: Fix timestop being 1 tile too small again, and fixes a lot of other field effects from being 1-small as well /:cl: Co-authored-by: MrMelbert <[email protected]>
- Loading branch information
Showing
4 changed files
with
38 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/// Regression test for timestop being a 3x3 instead of a 5x5 | ||
/datum/unit_test/timestop | ||
|
||
/datum/unit_test/timestop/Run() | ||
var/mob/living/carbon/human/dio = allocate(/mob/living/carbon/human/consistent) | ||
var/mob/living/carbon/human/kakyoin = allocate(/mob/living/carbon/human/consistent) | ||
var/mob/living/carbon/human/jotaro = allocate(/mob/living/carbon/human/consistent) | ||
|
||
var/turf/center = run_loc_floor_bottom_left | ||
var/turf/in_range = locate(center.x + 2, center.y + 2, center.z) | ||
var/turf/out_of_range = locate(in_range.x + 1, in_range.y + 1, in_range.z) | ||
|
||
dio.forceMove(center) | ||
kakyoin.forceMove(in_range) | ||
jotaro.forceMove(out_of_range) | ||
|
||
var/datum/action/cooldown/spell/timestop/timestop = new(dio) | ||
timestop.spell_requirements = NONE | ||
timestop.Grant(dio) | ||
timestop.Trigger() | ||
var/obj/effect/timestop/time_effect = locate() in center | ||
TEST_ASSERT(time_effect, "Failed to create timestop effect") | ||
sleep(0.1 SECONDS) // timestop is invoked async so let's just wait | ||
|
||
TEST_ASSERT(!dio.IsStun(), "Timestopper should not have frozen themselves when using timestop") | ||
TEST_ASSERT(kakyoin.IsStun(), "Timestopper should have frozen the target within 2 tiles of range when using timestop") | ||
TEST_ASSERT(!jotaro.IsStun(), "Timestopper should not have frozen the target outside of 2 tiles of range when using timestop") | ||
|
||
// cleanup | ||
qdel(time_effect) |