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

assertion failed in equipment-market.lua:91 #5883

Open
lolo101 opened this issue Aug 4, 2024 · 3 comments · May be fixed by #5734
Open

assertion failed in equipment-market.lua:91 #5883

lolo101 opened this issue Aug 4, 2024 · 3 comments · May be fixed by #5734

Comments

@lolo101
Copy link
Contributor

lolo101 commented Aug 4, 2024

Observed behaviour

Stack trace when buying a shield
Note that I bought 12 missiles and had to sell one to have enough room to equip a shield.
Since a missile is 0.5 tons, maybe the exception is caused by a fractional number or something?
Capture d’écran du 2024-08-04 19-34-32

Expected behaviour

No stack

Steps to reproduce

Reproducible always

  1. Go to the Equipment Market
  2. Buy a shield

My pioneer version (and OS):
20240314 (Linux)

My output.txt (required) and game save (optional, but recommended)
output.txt
lolo-stack.gz

@lolo101
Copy link
Contributor Author

lolo101 commented Aug 4, 2024

Note that if you sell an additional missile first, the exception does not raises

@impaktor
Copy link
Member

impaktor commented Aug 5, 2024

assert(player:AddEquip(e, 1, slot) == 1)

Looks like the second argument (count) is hard coded to 1, (both in RemoveEqupment and AddEquipment), might be relevant. I'll have to do some pondering.

Edit: I believe the 1 might be referring to slots, not tonnage.

@lolo101
Copy link
Contributor Author

lolo101 commented Aug 5, 2024

That's why it's useful to use named constants instead of magic numbers 😉

@Web-eWorks Web-eWorks linked a pull request Aug 25, 2024 that will close this issue
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants