diff --git a/code/__defines/atoms_movable.dm b/code/__defines/atoms_movable.dm new file mode 100644 index 0000000000..bbcf1eb6d1 --- /dev/null +++ b/code/__defines/atoms_movable.dm @@ -0,0 +1,7 @@ +/* +** Holds defines for code\game\atoms_movable.dm to avoid magic numbers and potential unexpected overwrites down the line +*/ + +#define DEFAULT_ICON_SCALE_X 1 +#define DEFAULT_ICON_SCALE_Y 1 +#define DEFAULT_ICON_ROTATION 0 diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 8d40c24964..97efe2f74b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -16,9 +16,9 @@ var/moved_recently = 0 var/mob/pulledby = null var/item_state = null // Used to specify the item state for the on-mob overlays. - var/icon_scale_x = 1 // Used to scale icons up or down horizonally in update_transform(). - var/icon_scale_y = 1 // Used to scale icons up or down vertically in update_transform(). - var/icon_rotation = 0 // Used to rotate icons in update_transform() + var/icon_scale_x = DEFAULT_ICON_SCALE_X // Used to scale icons up or down horizonally in update_transform(). + var/icon_scale_y = DEFAULT_ICON_SCALE_Y // Used to scale icons up or down vertically in update_transform(). + var/icon_rotation = DEFAULT_ICON_ROTATION // Used to rotate icons in update_transform() var/icon_expected_height = 32 var/icon_expected_width = 32 var/old_x = 0 @@ -47,6 +47,8 @@ add_overlay(list(em_block), TRUE) if(opacity) AddElement(/datum/element/light_blocking) + if(icon_scale_x != DEFAULT_ICON_SCALE_X || icon_scale_y != DEFAULT_ICON_SCALE_Y || icon_rotation != DEFAULT_ICON_ROTATION) + update_transform() switch(light_system) if(STATIC_LIGHT) update_light() diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3394e65b68..f0b2603eee 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -1218,7 +1218,7 @@ if(species.default_language) add_language(species.default_language) - if(species.icon_scale_x != 1 || species.icon_scale_y != 1) + if(species.icon_scale_x != DEFAULT_ICON_SCALE_X || species.icon_scale_y != DEFAULT_ICON_SCALE_Y) update_transform() if(example) //VOREStation Edit begin diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm index 6adc4a0bfd..f16106b393 100644 --- a/code/modules/mob/living/carbon/human/species/species.dm +++ b/code/modules/mob/living/carbon/human/species/species.dm @@ -35,8 +35,8 @@ var/tail_animation // If set, the icon to obtain tail animation states from. var/tail_hair - var/icon_scale_x = 1 // Makes the icon wider/thinner. - var/icon_scale_y = 1 // Makes the icon taller/shorter. + var/icon_scale_x = DEFAULT_ICON_SCALE_X // Makes the icon wider/thinner. + var/icon_scale_y = DEFAULT_ICON_SCALE_Y // Makes the icon taller/shorter. var/race_key = 0 // Used for mob icon cache string. var/icon/icon_template // Used for mob icon generation for non-32x32 species. diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index 918903a673..6d969b9b2d 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -1368,5 +1368,5 @@ /mob/living/set_dir(var/new_dir) . = ..() - if(size_multiplier != 1 || icon_scale_x != 1 && center_offset > 0) + if(size_multiplier != 1 || icon_scale_x != DEFAULT_ICON_SCALE_X && center_offset > 0) update_transform(TRUE) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index ca8bd99cbb..83cc6c8f7d 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -59,7 +59,6 @@ lastarea = get_area(src) set_focus(src) // VOREStation Add - Key Handling hook_vr("mob_new",list(src)) //VOREStation Code - update_transform() // Some mobs may start bigger or smaller than normal. . = ..() //return QDEL_HINT_HARDDEL_NOW Just keep track of mob references. They delete SO much faster now. diff --git a/vorestation.dme b/vorestation.dme index 1576ab1b1d..2c2ad11644 100644 --- a/vorestation.dme +++ b/vorestation.dme @@ -36,6 +36,7 @@ #include "code\__defines\appearance.dm" #include "code\__defines\assert.dm" #include "code\__defines\atmos.dm" +#include "code\__defines\atoms_movable.dm" #include "code\__defines\belly_modes_ch.dm" #include "code\__defines\belly_modes_vr.dm" #include "code\__defines\callbacks.dm"