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

The scanner remains active on screen when changing ship. #3027

Closed
walterar opened this issue Jul 8, 2014 · 6 comments
Closed

The scanner remains active on screen when changing ship. #3027

walterar opened this issue Jul 8, 2014 · 6 comments

Comments

@walterar
Copy link
Contributor

walterar commented Jul 8, 2014

.

@corundscale
Copy link

Confirmed. Equipment isn't properly cleared when you change a ship and remains usable even if not present on the new ship - this isn't limited to scanner.

Buying and selling the problematic piece equipment after the bug occurs doesn't change anything.

@laarmen
Copy link
Contributor

laarmen commented Jul 8, 2014

Yep. I'm not at any computer right now but I know what's going on.

Basically, when replacing the ship, the core just replaces the EquipSet with a new, empty one, without caring about what was installed. Thus, the stuff doesn't get uninstalled.

(I'm not at my computer right now and not in a shape to write code anyway, so i can't fix it right away)

I'd fix it by writing a EquipSet:Clear(ship) method that would uninstall every single piece of equipment from the equipset (and from the ship given as argument), by walking through all the slots subtables, and call this method from SetShipType in C++ before creating a new EquipSet.

This might be a good exercise to get accointed with the internals of EquipSet, and also on how to call a Lua method from C++ using the advanced tooling developed along with new-equipment (the CallMethod stuff). I'll be AFK for the next couple of days, although probably still reachable via IRC through my mobile phone if need be.

@walterar
Copy link
Contributor Author

walterar commented Jul 8, 2014

Ok. Meanwhile... I'm not sure how to migrate this, to new code:
if (ship:GetEquipFree ("LASER") < ShipDef [ship.shipId] equipSlotCapacity.LASER)
Some idea?

@johnbartholomew
Copy link
Contributor

@walterar I think that question is not related to this bug, so this issue is not the right place for it, but I have answered on the forum, thread New equipment migration questions

@walterar
Copy link
Contributor Author

walterar commented Jul 9, 2014

It does not work. Maybe I should open an new issue.

@walterar
Copy link
Contributor Author

#3052 fix this.

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

No branches or pull requests

4 participants