Repository navigation
v1.7.1 - Fix: reflect player damage to foreign structures
PVE Damage Guard v1.7.1 - bug fix. PvP reflect now also covers Player damaging another player's structure.
The bug
In v1.0 through v1.7.0, the PvP reflect feature was intended as a "punish griefing attempts" mechanism but only covered Player vs Player. When a player damaged another player's base (BuildingBlock / Door / Deployable), the damage was leaking through as vanilla damage. PVE servers running with the default config silently allowed this.
The fix
When ReflectPlayerDamageToForeignStructures = true (new config field, default true):
- Player attacks a structure
- If attacker is owner, on the owner's team, or TC-authorized on a BuildingBlock -> vanilla damage (you can still damage your own/team's base)
- Otherwise -> damage reflects back to the attacker at the configured
ReflectMultiplier
Monuments are not affected: monument structures have OwnerID == 0 and the new authorization check returns true for unowned entities, leaving monument loot containers / barrels at vanilla damage.
NPCs are not affected: the new branch runs only when victim is Building or Deployable. NPCs route through their existing branches unchanged.
What changed in /pdg test
Aim at a player-owned Building or Deployable and you'll now see your authorization status:
Target: wall.stone (type=BuildingBlock) classified as Building, subtype=<none>
Distance: 4.2m
If an NPC damages this building: NpcToStructure default 0.50x, Building grade multiplier 1.00x (grade=Stone).
Your authorization on this structure: NOT authorized (reflects damage back to you). OwnerID: 76561198000000000.
Useful for verifying the fix is working as expected on your server before triggering actual damage.
Config
To opt out (e.g. for a competitive build-and-raid server where players should be able to damage anyone's structures):
Install
Drop PVEDamageGuard.cs (below) into oxide/plugins/. Drop-in upgrade from v1.7.0; no config changes required if you accept the new default.
License
GPL-3.0