Jump to content

Bug in EPOCH_server_makeNPCTrade.sqf


He-Man

Recommended Posts

Hi,

there is a Bug when buying Vehicles from Trader.

When buying a Vehicle, the following code will push back the AI-Items to the DB:

_objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _slot];
["AI_ITEMS", _objHiveKey, EPOCH_expiresAIdata, [_itemClasses, _itemQtys]] call EPOCH_fnc_server_hiveSETEX;

Now it happens, that NOT the slot from the Trader will be pushed back. Instead, the Vehicle Slot will be pushed back. So the Trader becomes a duplicate with the vehicles slot in the DB.

When no other trade was made after this, after a restart the Vehicle will stay on the Map and also in the trader inventory (because the Vehicle was only deleted in the duplicate).

I can't retrace, why this happen. The code seems okay.

To fix it, you only have to change all _slot in the EPOCH_server_makeNPCTrade.sqf into _traderslot.

That's all :)

Edited by He-Man
Link to comment
Share on other sites

_objHiveKey = format["%1:%2", (call EPOCH_fn_InstanceID), _slot];

_slot looks same as in 0.3.4... Or has been fixed by another way?!

We will see ;)

If you compare them you will see the vehicle slot now uses its own variable (_vehSlot), the problem was that _slot was used for traders and then again incorrectly used for the vehicle slot.

Link to comment
Share on other sites

Ah, thanks for this Information!

 

Edit:

Doublechecked and found, that _vehSlot is already used in 0.3.4!

0.3.4:

_vehSlot = _vehicle getVariable["VEHICLE_SLOT", "ABORT"];

 

 

Because that I wrote, that for me the code seems ok.

I have no idea, where the codes becomes the wrong _slot from.

But again: _slot renaming into _traderslot seems to work.

Edited by He-Man
Link to comment
Share on other sites

  • 4 months later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...