KnuckleCracker / CW4-bug-tracker

The gathering point for bugs and supporting information, or suggestions about additional features.
Creative Commons Attribution Share Alike 4.0 International
13 stars 1 forks source link

[Bug][4RPL] A unit can erroneously request both energy and a ware at the same time #1080

Open grabz-dev opened 8 months ago

grabz-dev commented 8 months ago
  1. Create a new custom unit.
  2. Have the unit connect to network, request packets, request ammo packets, Switch the unit's ammo type to a ware e.g. Liftic.
  3. Add the following script that, after some time, switches the unit's ammo type from its default ware type to energy type.
    
    GetTimer0 1 eq if
    SetUnitAmmo(Self 0)
    SetUnitAmmoWare(Self 0)
    endif

:once 300 SetTimer0


4. After the unit has switched to energy, save and load the game.
5. The unit now requests both energy and the original ware type at the same time.

The way to get around this issue is to make sure that if a unit that needs to initially accept a ware, and then is going to switch its ammo type to energy at some point, the unit's original ammo type must remain as Energy, and the ammo has to be switched to the desired ware using SetUnitAmmoWare at the beginning of  the unit's lifecycle.