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

[Bug]: Rebel AA trucks have incorrect real cost #2150

Closed
jaj22 opened this issue Sep 27, 2021 · 0 comments · Fixed by #2151
Closed

[Bug]: Rebel AA trucks have incorrect real cost #2150

jaj22 opened this issue Sep 27, 2021 · 0 comments · Fixed by #2151
Labels
Bug Something isn't working Merge pending A PR is submitted
Milestone

Comments

@jaj22
Copy link

jaj22 commented Sep 27, 2021

Describe the bug

AA trucks are calculated in the tooltip as 2*staticCrew price + vehSDKTruck price * staticAAteamPlayer price, with what I think is a matching funds check in addFIAsquadHC. However, spawnHCGroup calculates the vehicle price component as simply the price of the spawned vehicle type, which is much lower: vehSDKTruck price for vanilla, or 0 for anything else, as vehSDKAA lacks a price definition.

Not sure on the best fix. vehSDKAA could gain a price definition, but unless that's synchronised with truck + static then that may cause trouble in the future. Vanilla would either need a special case or processing of attached objects.

How to reproduce

  1. Recruit a rebel AA truck in vanilla.
  2. Recruit a rebel AA truck in RHS.

Version

2.5.3

Have you altered the code?

No

What i have changed

No response

Map

Doesn't matter

What server?

LAN Hosted

Time bug occured (Server time/UTC)

No response

Mods

No response

Additional context

No response

@jaj22 jaj22 added the Bug Something isn't working label Sep 27, 2021
@jaj22 jaj22 added this to the 2.5.3 milestone Sep 27, 2021
@jaj22 jaj22 added the Merge pending A PR is submitted label Oct 1, 2021
Bob-Murphy pushed a commit that referenced this issue Oct 2, 2021
### What type of PR is this.
1. [X] Bug
2. [ ] Change
3. [ ] Enhancement

### What have you changed and why?
Both constructed and single-vehicle AA trucks were being underpriced on purchase due to not calculating truck + static AA costs as the other code did. This PR fixes this for both cases with a horrible hack.    

**Edit:** Additional vehicle price bugs fixed:
- Fixed doubled check price for AA and AT vehicles (missing isInfantry check).
- Fixed AT car check price adding SDKTruck price.
- Fixed ancient bug where zu-23 rebel AA trucks were not refunded on dismissal.
- Fixed bug where vanilla AA trucks were double-refunded.
- Fixed misleading error message when you didn't have enough money to purchase a transport vehicle.
- Fixed wrong price shown for transport vehicle.
- Fixed squad mortars and MGs not being charged for.

### Please specify which Issue this PR Resolves.
closes #2150
closes #2152

### Please verify the following and ensure all checks are completed.
1. [X] Have you loaded the mission in LAN host?
2. [ ] Have you loaded the mission on a dedicated server?

### Is further testing or are further changes required?
1. [X] No
2. [ ] Yes (Please provide further detail below.)

Notes:
* Horrible fix for AA truck prices

* Fix multiple rebel squad-vehicle price checking bugs

* Fix more HC squad price bugs

* Don't try to refund weird attached objects on HC dismissal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Merge pending A PR is submitted
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant