JoSchaap / GoT_Wasteland_V2.Stratis

WARNING! This repo is no longer updated, find the updated version on the A3Wasteland git! -
http://www.a3wasteland.com
11 stars 20 forks source link

Selling items in the gunstore #59

Closed s3kShUn61 closed 10 years ago

s3kShUn61 commented 10 years ago

I fixed a problem where all items sold in the gunstore were worth 25. In sellWeapon.sqf there this line: _weapon_value = 25; // This is for weapons that aren't in the gunstore stock list. TODO fix the sell price.

which obviously sets the value to 25 when it cannot be found in the list. However, this is done after _weapon_value is set to the actual value so it overrides it to 25. I simply moved it above the _weapon_value = _x select 3 line so it will not override the correct _weapon_value.

JoSchaap commented 10 years ago

easy enough :)

fixed in c4ff88fac9cd65c53c29439e65946e2034afdcaa

AgentRev commented 10 years ago

Not sure if you have noticed, but this also discards all of the weapon's magazines from the inventory of the player without monetary compensation.

Check client/systems/gunStore/sellWeapon.sqf in my master to see how I fixed that. Basically, for each compatible magazine, I give back half its price in the gunstore, ceiled up to the next multiple of 5. The value is calculated on the fly because ammoArray doesn't have sell prices, although it could be a good thing to add sell prices for more flexibility.

The only drawback is that it's impossible to get the ammo count from a magazine in the inventory, so you can't ajust the price based on how much ammo is left in it.

I will probably make it so it doesn't sell compatible ammo if the gun has no loaded mag.

JoSchaap commented 10 years ago

or just dont allow ammo selling xD