Skip to content

Commit

Permalink
car_charge_amount_fix: handle using cells on Trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
phobos2077 committed Jun 3, 2024
1 parent bde80cf commit cb7429a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/ecco_changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ v0.9.7:

> Misc:
- added option for additional car trunk capacity upgrade with Repair skill
- fixed incorrect car charging amount when using Cells on trunk


v0.9.6:
Expand Down
3 changes: 2 additions & 1 deletion scripts_src/_pbs_main/gl_car_charge_amount_fix.ssl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include "../sfall/lib.obj.h"
#include "../sfall/define_lite.h"

#define PID_CAR_TRUNK (455)
#define PID_DRIVABLE_CAR (33555441)
#define PID_SMALL_ENERGY_CELL (38)
#define PID_MICRO_FUSION_CELL (39)
Expand All @@ -15,7 +16,7 @@ procedure useobjon_hook begin

//display_msg(string_format("useobjon: %s uses %s on %s", obj_name_safe(user), obj_name_safe(item), obj_name_safe(target)));
if (target and item and
obj_pid(target) == PID_DRIVABLE_CAR and
(obj_pid(target) == PID_DRIVABLE_CAR or obj_pid(target) == PID_CAR_TRUNK) and
user == dude_obj and (obj_pid(item) == PID_MICRO_FUSION_CELL or obj_pid(item) == PID_SMALL_ENERGY_CELL) and
car_gas_amount < GAS_TANK_CAPACITY) then
begin
Expand Down

0 comments on commit cb7429a

Please sign in to comment.