Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Glide size is now determined by cpu usage. #4146

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dwasint
Copy link
Collaborator

@dwasint dwasint commented Nov 7, 2024

About The Pull Request

Non player facing change so no CL
tgstation/tgstation#85971

Why It's Good For The Game

Makes movement feel smoother

Changelog

🆑
/:cl:

@Absolucy
Copy link
Collaborator

Absolucy commented Nov 7, 2024

imo it is somewhat user facing, if the effect is making movement feel smoother, even if it's a minor one.

code/modules/mob/mob_movement.dm Outdated Show resolved Hide resolved
var/error = max((last_cpu - 100) / 100 * world.tick_lag, 0)

for(var/atom/movable/trouble as anything in GLOB.gliding_atoms)
if(world.time >= trouble.glide_stopping_time || QDELETED(trouble))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(world.time >= trouble.glide_stopping_time || QDELETED(trouble))
if(world.time >= trouble.glide_stopping_time || QDELING(trouble))

QDELETED(trouble) is just (isnull(trouble) || QDELING(trouble)) - and we'd runtime here anyways if trouble is null.

// cache for sonic speed
cpu_values[cpu_index] = real_cpu
GLOB.avg_cpu_values[cpu_index] = avg_cpu
GLOB.cpu_index = WRAP(cpu_index + 1, 1, CPU_SIZE + 1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
GLOB.cpu_index = WRAP(cpu_index + 1, 1, CPU_SIZE + 1)
WRAP_UP(GLOB.cpu_index, CPU_SIZE + 1)

double check that it's the same tho, just to be 100% sure

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would need to run a few number tests but I think WRAP_UP would be different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants