diff --git a/code/__HELPERS/type2type.dm b/code/__HELPERS/type2type.dm index f90a9c4e5ad..ae7704459b5 100644 --- a/code/__HELPERS/type2type.dm +++ b/code/__HELPERS/type2type.dm @@ -157,6 +157,17 @@ if(degree < 315) return WEST return NORTH|WEST +/proc/angle2dir_cardinal(angle) + switch(round(angle, 0.1)) + if(315.5 to 360, 0 to 45.5) + return NORTH + if(45.6 to 135.5) + return EAST + if(135.6 to 225.5) + return SOUTH + if(225.6 to 315.5) + return WEST + //returns the north-zero clockwise angle in degrees, given a direction /proc/dir2angle(var/D) diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm index 9dc7d735191..3b36528469e 100644 --- a/code/modules/client/client procs.dm +++ b/code/modules/client/client procs.dm @@ -314,7 +314,6 @@ GLOB.clients += src GLOB.directory[ckey] = src - //Admin Authorisation // Automatically makes localhost connection an admin if(!config.disable_localhost_admin) @@ -369,8 +368,6 @@ . = ..() //calls mob.Login() - if(SSinput.initialized) - set_macros() if(ckey in clientmessages) for(var/message in clientmessages[ckey]) @@ -404,7 +401,9 @@ if(!winexists(src, "asset_cache_browser")) // The client is using a custom skin, tell them. to_chat(src, "Unable to access asset cache browser, if you are using a custom skin file, please allow DS to download the updated version, if you are not, then make a bug report. This is not a critical issue but can cause issues with resource downloading, as it is impossible to know when extra resources arrived to you.") - + if(SSinput.initialized) + set_macros() + //This is down here because of the browse() calls in tooltip/New() if(!tooltips) tooltips = new /datum/tooltip(src) diff --git a/code/modules/keybindings/setup.dm b/code/modules/keybindings/setup.dm index c2d24f685d1..3ece29bd315 100644 --- a/code/modules/keybindings/setup.dm +++ b/code/modules/keybindings/setup.dm @@ -43,5 +43,4 @@ var/key = macro_set[k] var/command = macro_set[key] winset(src, "[setname]-[REF(key)]", "parent=[setname];name=[key];command=[command]") - winset(src, null, "input.focus=true input.background-color=[COLOR_INPUT_ENABLED] mainwindow.macro=default") diff --git a/code/modules/mob/mob_movement.dm b/code/modules/mob/mob_movement.dm index 6bf74f26409..ecdac28133c 100644 --- a/code/modules/mob/mob_movement.dm +++ b/code/modules/mob/mob_movement.dm @@ -245,9 +245,9 @@ moving = 1 var/delay = mob.movement_delay() if(old_move_delay + (delay * MOVEMENT_DELAY_BUFFER_DELTA) + MOVEMENT_DELAY_BUFFER > world.time) - move_delay = old_move_delay + delay + move_delay = old_move_delay else - move_delay = delay + world.time + move_delay = world.time mob.last_movement = world.time if(locate(/obj/item/grab, mob)) @@ -295,17 +295,17 @@ n = get_step(mob, direct) . = ..() - // mob.setDir(direct) + //mob.setDir(direct) for(var/obj/item/grab/G in mob) if(G.state == GRAB_NECK) - mob.setDir(reverse_dir[direct]) + mob.setDir(angle2dir((dir2angle(direct) + 202.5) % 365)) G.adjust_position() for(var/obj/item/grab/G in mob.grabbed_by) G.adjust_position() if((direct & (direct - 1)) && mob.loc == n) //moved diagonally successfully delay = mob.movement_delay() * 2 - move_delay += delay + move_delay += delay moving = 0 if(mob && .) if(mob.throwing)