From 75b628df57f6c6a97add511fb3a3e2af233e40b6 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Sun, 12 Oct 2014 13:06:31 +0000 Subject: [PATCH] Fix: Adding mercs to a vehicle when the player already has the maximum number of vehicles caused the game to crash on the next move order. Trying to add more mercs to a vehicle than there was seats caused an error message with a 'null' name for the vehicle. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7554 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Strategic/Assignments.cpp | 2 +- Tactical/Vehicles.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index 17fa6000..6ab3e955 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -8392,7 +8392,7 @@ void VehicleMenuBtnCallback( MOUSE_REGION * pRegion, INT32 iReason ) } else { - ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, gzLateLocalizedString[ 18 ], zVehicleName[ pVehicleList[ iVehicleID ].ubVehicleType ] ); + ScreenMsg( FONT_MCOLOR_LTYELLOW, MSG_UI_FEEDBACK, gzLateLocalizedString[ 18 ], gNewVehicle[ pVehicleList[ iVehicleID ].ubVehicleType ].NewVehicleStrings ); } fShowAssignmentMenu = FALSE; diff --git a/Tactical/Vehicles.cpp b/Tactical/Vehicles.cpp index 00fb22e6..bba74377 100644 --- a/Tactical/Vehicles.cpp +++ b/Tactical/Vehicles.cpp @@ -1718,7 +1718,8 @@ BOOLEAN EnterVehicle( SOLDIERTYPE *pVehicle, SOLDIERTYPE *pSoldier, UINT8 ubSeat } // OK, add.... - AddSoldierToVehicle( pSoldier, pVehicle->bVehicleID, ubSeatIndex ); + if ( !AddSoldierToVehicle( pSoldier, pVehicle->bVehicleID, ubSeatIndex) ) + return( FALSE); if ( !(guiTacticalInterfaceFlags & INTERFACE_MAPSCREEN ) ) {