- Fix crasher in doStepSniperRifleShot
authorunc0rr
Mon, 03 Mar 2014 22:36:30 +0400
changeset 10174 710ffaae7d59
parent 10173 fff5e4b0dfcb
child 10175 c92668840ea8
- Fix crasher in doStepSniperRifleShot - Fix hwLibrary.pas dependencies list
hedgewars/CMakeLists.txt
hedgewars/uGearsHandlersMess.pas
--- a/hedgewars/CMakeLists.txt	Sun Mar 02 00:34:18 2014 +0400
+++ b/hedgewars/CMakeLists.txt	Mon Mar 03 22:36:30 2014 +0400
@@ -211,8 +211,7 @@
     add_flag_prepend(CMAKE_Pascal_FLAGS "-o${LIBRARY_OUTPUT_PATH}/${engine_output_name}")
 
     add_definitions(-dHWLIBRARY)
-    set_source_files_properties(hwLibrary.pas PROPERTIES OBJECT_DEPENDS "${sourcefiles_sofar}")
-    set_source_files_properties(hwLibrary.pas PROPERTIES OBJECT_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/hwengine.pas")
+    set_source_files_properties(hwLibrary.pas PROPERTIES OBJECT_DEPENDS "${sourcefiles_sofar};${CMAKE_CURRENT_SOURCE_DIR}/hwengine.pas")
     add_library(hwengine SHARED hwLibrary.pas)
 else()
     # no need to change name here because target has same name
--- a/hedgewars/uGearsHandlersMess.pas	Sun Mar 02 00:34:18 2014 +0400
+++ b/hedgewars/uGearsHandlersMess.pas	Mon Mar 03 22:36:30 2014 +0400
@@ -1316,6 +1316,13 @@
 begin
     cArtillery := true;
     HHGear := Gear^.Hedgehog^.Gear;
+
+    if HHGear = nil then
+        begin
+        DeleteGear(gear);
+        exit
+        end;
+
     HHGear^.State := HHGear^.State or gstNotKickable;
     HedgehogChAngle(HHGear);
     if not cLaserSighting then