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

Weapon on sale not installed #5567

Closed
DynV opened this issue Mar 7, 2023 · 3 comments
Closed

Weapon on sale not installed #5567

DynV opened this issue Mar 7, 2023 · 3 comments

Comments

@DynV
Copy link

DynV commented Mar 7, 2023

Observed behaviour

If buying a weapon on sale without selling your current one 1st, it won't install BUT it will subtract the amount from your account.

Since the related part of #5539 didn't take off there, I'm forking it here. The shorter video shows the issue, the longer one is the workaround.

2023-03-06.22-18-37.mp4
2023-03-06.21-37-16.mp4

Expected behaviour

Either

  • the weapon get installed when the money for it is reduced or
  • no weapon is installed and the money stay the same.

Steps to reproduce

  1. Load gamesave
  2. notice current weapon & money
  3. buy Large plasma accelerator on sale (in Bulletin Board)
  4. notice if there was a change in weapon or money.

My pioneer version (and OS):
20230203-win

My output.txt (required) and game save (optional, but recommended)
The game save file was simply renamed to go through the upload extension filter, there was no modification to its content.
output.txt
Pioneer-Yoan_Faure-20230203-230425-Large_plasma_accelerator_on_sale_having_enough_money.zip

@impaktor
Copy link
Member

impaktor commented Mar 8, 2023

Just looking at the code, for some reason, the Game.player:GetEquipFree(e.slots[i]) doesn't register that a slot is already taken, I assume there's been some code breaking change that changed how it works.

(There is no code for swapping, so the proper thing is for the advert to tell the player to first sell the current equipment, before fitting the new).

@impaktor
Copy link
Member

impaktor commented Mar 8, 2023

OK, I've done some test. The code works if doing it with a ship that only has one weapon slot (laser_rear:0). The problem is that pioneer atm, doesn't support fitting rear lasers (it was broken a while ago, when the equipment system got upgraded). Thus the module correctly identifies there's a free slot, and does the transaction, but the Pioneer engine can't fit the weapon.

According to @Web-eWorks the slot system is on its way out, and will soon be replaced with hardpoint system, so no point in spending time on code that's about to be replaced within a month or a few. I'll spend that time on writing new code instead.

If anyone want to fix their pioneer, just open all json files in data/ships/ and set "laser_rear: 0", meanwhile.

I suppose we'll leave this bug report open until the new code is in place.

@sturnclaw
Copy link
Member

Fixed in #5734.

@github-project-automation github-project-automation bot moved this from Stage 1 to Stage 3 in Equipment Rewrite Nov 4, 2024
@sturnclaw sturnclaw moved this from Stage 3 to Done in Equipment Rewrite Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants