Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
#define NO_DEBUG_CRC

#include "Common/PerfTimer.h"
#include "Common/Player.h"
#include "Common/ThingTemplate.h"
#include "Common/Xfer.h"
#include "GameClient/FXList.h"
#include "GameLogic/GameLogic.h"
#include "GameLogic/Module/AIUpdate.h"
#include "GameLogic/Module/BodyModule.h"
Expand Down Expand Up @@ -1262,7 +1264,26 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3
// fall into a nonbuilding -- whatever. if we're a vehicle, quietly do a little damage.
if (obj->isKindOf(KINDOF_VEHICLE))
{
#if RETAIL_COMPATIBLE_CRC
TheWeaponStore->createAndFireTempWeapon(getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoNonBuildingWeaponTemplate, obj, obj->getPosition());
#else
// TheSuperHackers @bugfix Stubbjax 19/04/2026 Prevent non-building collisions from repeatedly dealing collateral damage to other objects.
const WeaponTemplate* weaponTemplate = getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoNonBuildingWeaponTemplate;
if (weaponTemplate != nullptr)
{
WeaponBonus nullBonus;

DamageInfo damageInfo;
damageInfo.in.m_damageType = weaponTemplate->getDamageType();
damageInfo.in.m_deathType = weaponTemplate->getDeathType();
damageInfo.in.m_sourceID = obj->getID();
damageInfo.in.m_sourcePlayerMask = obj->getControllingPlayer() ? obj->getControllingPlayer()->getPlayerMask() : 0;
damageInfo.in.m_amount = weaponTemplate->getPrimaryDamage(nullBonus);
Comment thread
xezon marked this conversation as resolved.

other->attemptDamage(&damageInfo);
FXList::doFXObj(weaponTemplate->getFireFX(obj->getVeterancyLevel()), obj);
}
#endif
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
#define NO_DEBUG_CRC

#include "Common/PerfTimer.h"
#include "Common/Player.h"
#include "Common/ThingTemplate.h"
#include "Common/Xfer.h"
#include "GameClient/FXList.h"
#include "GameLogic/GameLogic.h"
#include "GameLogic/Module/AIUpdate.h"
#include "GameLogic/Module/BodyModule.h"
Expand Down Expand Up @@ -1387,7 +1389,26 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3
// fall into a nonbuilding -- whatever. if we're a vehicle, quietly do a little damage.
if (obj->isKindOf(KINDOF_VEHICLE))
{
#if RETAIL_COMPATIBLE_CRC
TheWeaponStore->createAndFireTempWeapon(getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoNonBuildingWeaponTemplate, obj, obj->getPosition());
#else
// TheSuperHackers @bugfix Stubbjax 19/04/2026 Prevent non-building collisions from repeatedly dealing collateral damage to other objects.
const WeaponTemplate* weaponTemplate = getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoNonBuildingWeaponTemplate;
if (weaponTemplate != nullptr)
{
WeaponBonus nullBonus;

DamageInfo damageInfo;
damageInfo.in.m_damageType = weaponTemplate->getDamageType();
damageInfo.in.m_deathType = weaponTemplate->getDeathType();
damageInfo.in.m_sourceID = obj->getID();
damageInfo.in.m_sourcePlayerMask = obj->getControllingPlayer() ? obj->getControllingPlayer()->getPlayerMask() : 0;
damageInfo.in.m_amount = weaponTemplate->getPrimaryDamage(nullBonus);
Comment thread
greptile-apps[bot] marked this conversation as resolved.

other->attemptDamage(&damageInfo);
FXList::doFXObj(weaponTemplate->getFireFX(obj->getVeterancyLevel()), obj);
}
#endif
}
}
}
Expand Down
Loading