fixes inconsistent lighting ci failure in icebox (#67430)

Fixes and adds test for get_pixel_turf returning null on tall objects on top of the map.
This commit is contained in:
Kylerace
2022-06-07 20:19:54 +02:00
committed by GitHub
parent dbc4d31062
commit 040c664ec2
3 changed files with 14 additions and 2 deletions
+1
View File
@@ -92,6 +92,7 @@
#include "emoting.dm"
#include "food_edibility_check.dm"
#include "gas_transfer.dm"
#include "get_turf_pixel.dm"
#include "greyscale_config.dm"
#include "heretic_knowledge.dm"
#include "heretic_rituals.dm"
+11
View File
@@ -0,0 +1,11 @@
///ensures that get_turf_pixel() returns turfs within the bounds of the map,
///even when called on a movable with its sprite out of bounds
/datum/unit_test/get_turf_pixel
/datum/unit_test/get_turf_pixel/Run()
//we need long larry to peek over the top edge of the earth
var/turf/north = locate(1, world.maxy, run_loc_floor_bottom_left.z)
//hes really long, so hes really good at peaking over the edge of the map
var/mob/living/simple_animal/hostile/megafauna/colossus/long_larry = allocate(/mob/living/simple_animal/hostile/megafauna/colossus, north)
TEST_ASSERT(istype(get_turf_pixel(long_larry), /turf), "get_turf_pixel() isnt clamping a mob whos sprite is above the bounds of the world inside of the map.")