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 @@ -1252,7 +1254,26 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3
// fall into a building. if a vehicle, blow up. then destroy ourself (not die), regardless.
if (obj->isKindOf(KINDOF_VEHICLE))
{
#if RETAIL_COMPATIBLE_CRC
TheWeaponStore->createAndFireTempWeapon(getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoBuildingWeaponTemplate, obj, obj->getPosition());
#else
// TheSuperHackers @bugfix Stubbjax 17/05/2026 Prevent building collisions from dealing collateral damage to other objects.
const WeaponTemplate* weaponTemplate = getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoBuildingWeaponTemplate;
if (weaponTemplate != nullptr)
Comment thread
xezon marked this conversation as resolved.
{
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);

other->attemptDamage(&damageInfo);
FXList::doFXObj(weaponTemplate->getFireFX(obj->getVeterancyLevel()), obj);
Comment thread
xezon marked this conversation as resolved.
}
#endif
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
TheGameLogic->destroyObject(obj);
return;
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 @@ -1377,7 +1379,26 @@ void PhysicsBehavior::onCollide( Object *other, const Coord3D *loc, const Coord3
// fall into a building. if a vehicle, blow up. then destroy ourself (not die), regardless.
if (obj->isKindOf(KINDOF_VEHICLE))
{
#if RETAIL_COMPATIBLE_CRC
TheWeaponStore->createAndFireTempWeapon(getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoBuildingWeaponTemplate, obj, obj->getPosition());
#else
// TheSuperHackers @bugfix Stubbjax 17/05/2026 Prevent building collisions from dealing collateral damage to other objects.
const WeaponTemplate* weaponTemplate = getPhysicsBehaviorModuleData()->m_vehicleCrashesIntoBuildingWeaponTemplate;
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);

other->attemptDamage(&damageInfo);
FXList::doFXObj(weaponTemplate->getFireFX(obj->getVeterancyLevel()), obj);
}
#endif
}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
TheGameLogic->destroyObject(obj);
return;
Expand Down
Loading