Open steadyfield opened 1 year ago
Well, I know about this bug. That's can be fixed by inserting null pointer check, but maybe that's not right solution of this problem
I will check this out
Well, I know about this bug. That's can be fixed by inserting null pointer check, but maybe that's not right solution of this problem
@nillerusr Thanks for checking this problem out. And yeah, as what you've said, inserting null pointer check (everywhere) in the game code may not be the right solution of this problem. Because I have found more game crashing problems caused by null pointer
. For example, the func_tankapcrocket
(this is an automatic rocket turret entity, spawned by my custom entity script) crash in the EP2 strider defense level, or parented to a vehicle and the player drives the vehicle pass through the "level changing region", caused by a null pointer in CBaseEntity::CalcAbsolutePosition
. Is it possible to incorporate the null pointer check
in the engine-level, rather than the game-level (or source-sdk-level)? This can be very useful for non-binary-code game modding (by .cfg entity scripts) as there will be less crashes.
The func_tankapcrocket
entity script can be found here, which is fun to play on some simple maps like gm_flatgrass
in which the game will not crash by the null pointer problem:
https://github.com/steadyfield/HL2_Entity_Script/blob/main/auto_weapon/create_auto_apcrocketlauncher.cfg
Game: HL2 & EP1 &EP2
Tested on version: Android Source Engine V1.16: CRASH Android Source Engine V1.09: CRASH Windows version Source Engine compiled from [latest] code: CRASH
To reproduce the problem: Step 1: Load a map, I used an old version of
gm_flatgrass
or a custom map I made. Step 2: In console, entersv_cheats 1
, thench_createairboat
to create an airboat. Step 3: In console, enterent_create npc_helicopter
orgive npc_helicopter
to create a helicopter NPC. Step 4: Enter the airboat, then the game will CRASH.Also, I tried some other NPCs, such as APC (
prop_vehicle_apc
+npc_apcdriver
) by using my entity .cfg script, sometimes the game will also crash as the player enters the airboat. Maybe for thenpc_strider
, the game will also crash?On Windows version, attaching
hl2_launcher.exe
toVisual Studio
for debugging, when the game crashes, the VS says "ACCESS VIOLATION" stops atconst Vector &vecTarget = m_pCurrentPathTarget->GetAbsOrigin();
invoid CAI_TrackPather::UpdateCurrentTargetLeading()
inai_trackpather.cpp
.Here is the "Call Stack":