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

fix: work-around game creating creeps with id of type number #9

Merged
merged 2 commits into from
Mar 25, 2024

Conversation

wtfrank
Copy link
Contributor

@wtfrank wtfrank commented Mar 25, 2024

seems to happen on spawn & swamp but not on ctf mode. documentation states that creep.id is of type string, so this is a bug in the game.

work-around for #4

I thought about solving this from javascript side (by adding a method to creep prototype which returns calls creep.id.toString() and returning that). However the api doesn't provide any javascript so I did the fix on the rust side - in the case where a creep has a numeric id, this fix creates converts the number to a string on the rust side, then sends that to the js side to create a string so there is a small cost.

wtfrank and others added 2 commits March 25, 2024 18:13
seems to happen on spawn & swamp but not on ctf mode.
documentation states that creep.id is of type string, so this is a bug
in the game.

work-around for rustyscreeps#4
@shanemadden shanemadden merged commit 3971c8c into rustyscreeps:main Mar 25, 2024
7 checks passed
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