Skip to content

Bug Report - v0.9.6.3: VehicleBreakdowns.lua duplicated + tyre wear doubled #150

@Squallqt

Description

@Squallqt

Bug Report - v0.9.6.3: VehicleBreakdowns.lua duplicated + regressions

Mod version: 0.9.6.3
Context: Dedicated server, updated from 0.9.6.2


1. VehicleBreakdowns.lua contains the entire specialization twice

The file is now 10,326 lines. Every core function is defined twice:

Function Copy 1 (dead) Copy 2 (active)
isExcluded 421 5584
onLoad 469 5632
onPostLoad 1036 6197
onReadStream 1242 6403
onWriteStream 1323 6484
onReadUpdateStream 1397 6558
onWriteUpdateStream 1510 6671

In Lua, the second definition silently overwrites the first. The first ~5,500 lines are dead code ignored at runtime. Any fix applied to copy 1 has no effect.


2. Vanilla damage bar never resets (caused by duplication)

The needsInitialDamageSync = true flag is set at line 872, which is in copy 1 (dead code). The active onLoad at line 5632 never sets this flag. As a result, rvbWearable.updateDamageAmount never enters the initial sync branch, and without the motor running it returns 0 without calling setDamageAmount. The vanilla damage bar keeps showing stale wear values.


3. Tyre wear doubled: injPhysWheelUpdateContact appended twice

Utils.appendedFunction(WheelPhysics.updateContact, VehicleBreakdowns.injPhysWheelUpdateContact) is called at two separate locations:

  • Line 6373 in onLoadFinished
  • Line 8738 in the reset/workshop path

Utils.appendedFunction stacks, it does not replace. Each call adds another execution of injPhysWheelUpdateContact to the chain. The tyre wear function runs twice per frame, doubling wear speed. This explains why tyre wear values jumped significantly after the update on the same savegame with no gameplay in between.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions