From d59a320d698180d188c1a296480970c7790b5e6f Mon Sep 17 00:00:00 2001 From: Kawe Mazidjatari <48657826+Mauler125@users.noreply.github.com> Date: Wed, 9 Aug 2023 02:56:58 +0200 Subject: [PATCH] Remove 'Error(EXIT_FAILURE)' call from 'CreateWeaponBolt()' The bug has been fixed in the engine. --- r5dev/game/shared/r1/weapon_bolt.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/r5dev/game/shared/r1/weapon_bolt.cpp b/r5dev/game/shared/r1/weapon_bolt.cpp index 963544ef..6eefe12c 100644 --- a/r5dev/game/shared/r1/weapon_bolt.cpp +++ b/r5dev/game/shared/r1/weapon_bolt.cpp @@ -13,7 +13,14 @@ CBaseEntity* CreateWeaponBolt(Vector3D* origin, Vector3D* end, __int64 unused, f // Code does NOT check for null, and performing inline assembly is kind of a waste. // This only happens when 'EntityFactoryDictionary' fails, which only happens when // there are no edict slots available anymore (usually a bug in scripts). - Error(eDLL_T::SERVER, EXIT_FAILURE, "Unable to create bolt for %s", UTIL_GetEntityScriptInfo(player)); + //Error(eDLL_T::SERVER, EXIT_FAILURE, "Unable to create bolt for %s", UTIL_GetEntityScriptInfo(player)); + + // Amos: The engine code has been modified on assembly level, function + // 'FireWeaponBolt' now checks the pointer returned by this function, + // and returns null if null (script should be able to handle this error + // or cause a soft crash if the entity handle is being used). + + Assert(0); } return weaponBolt;