Skip to content

Commit

Permalink
Remove dead code for langchat rotations (#3756)
Browse files Browse the repository at this point in the history
# About the pull request

This PR removes some unused code as of #671 

# Explain why it's good for the game

Less work for the server when updating a mob's transform.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

Put screenshots and videos here with an empty line between the
screenshots and the `<details>` tags.

</details>

# Changelog
:cl: Drathek
code: Removed unnecessary calculations when updating a mob's transform.
/:cl:
  • Loading branch information
Drulikar committed Jun 29, 2023
1 parent 156fa39 commit 2e67589
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
8 changes: 3 additions & 5 deletions code/game/objects/objs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,11 +302,9 @@
src.add_fingerprint(user)
afterbuckle(target)
if(buckle_lying) // Make sure buckling to beds/nests etc only turns, and doesn't give a random offset
var/matrix/M = matrix()
var/matrix/L = matrix() //Counterrotation for langchat text.
M.Turn(90)
L.Turn(270)
target.apply_transform(M)
var/matrix/new_matrix = matrix()
new_matrix.Turn(90)
target.apply_transform(new_matrix)
return TRUE

/obj/proc/send_buckling_message(mob/M, mob/user)
Expand Down
18 changes: 7 additions & 11 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,23 +94,19 @@ There are several things that need to be remembered:
if(lying == lying_prev && !force)
return
lying_prev = lying
var/matrix/M = matrix()
var/matrix/L = matrix() //Counter-rotation for langchat text.
var/matrix/new_matrix = matrix()
if(lying)
if(pulledby && pulledby.grab_level >= GRAB_CARRY)
M.Turn(90)
L.Turn(270)
new_matrix.Turn(90)
else
if(prob(50))
M.Turn(90)
L.Turn(270)
new_matrix.Turn(90)
else
M.Turn(270)
L.Turn(90)
M.Translate(rand(-10,10),rand(-10,10))
apply_transform(M)
new_matrix.Turn(270)
new_matrix.Translate(rand(-10,10), rand(-10,10))
apply_transform(new_matrix)
else
apply_transform(M)
apply_transform(new_matrix)

/mob/living/carbon/human/UpdateDamageIcon()
for(var/obj/limb/O in limbs)
Expand Down

0 comments on commit 2e67589

Please sign in to comment.