summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/animation/AnimBlendAssociation.h5
-rw-r--r--src/animation/FrameUpdate.cpp6
-rw-r--r--src/audio/oal/aldlist.cpp4
-rw-r--r--src/audio/oal/aldlist.h4
-rw-r--r--src/control/CarAI.cpp1
-rw-r--r--src/control/CarCtrl.cpp1
-rw-r--r--src/control/Garages.cpp3
-rw-r--r--src/control/Pickups.cpp2
-rw-r--r--src/control/SceneEdit.cpp4
-rw-r--r--src/control/Script.cpp2
-rw-r--r--src/core/AnimViewer.cpp4
-rw-r--r--src/core/Cam.cpp2
-rw-r--r--src/core/Camera.cpp16
-rw-r--r--src/core/Camera.h3
-rw-r--r--src/core/Collision.cpp2
-rw-r--r--src/core/ControllerConfig.cpp16
-rw-r--r--src/core/FileLoader.cpp2
-rw-r--r--src/core/Frontend.cpp3
-rw-r--r--src/core/Frontend.h2
-rw-r--r--src/core/Pad.cpp4
-rw-r--r--src/core/Pools.cpp4
-rw-r--r--src/core/Profile.cpp4
-rw-r--r--src/core/Profile.h4
-rw-r--r--src/core/Streaming.cpp3
-rw-r--r--src/core/SurfaceTable.cpp2
-rw-r--r--src/core/SurfaceTable.h2
-rw-r--r--src/core/World.cpp1
-rw-r--r--src/core/main.cpp10
-rw-r--r--src/core/main.h4
-rw-r--r--src/modelinfo/PedModelInfo.cpp2
-rw-r--r--src/objects/ParticleObject.cpp10
-rw-r--r--src/peds/EmergencyPed.cpp2
-rw-r--r--src/peds/Ped.cpp18
-rw-r--r--src/render/Particle.cpp3
-rw-r--r--src/render/WaterLevel.cpp2
-rw-r--r--src/render/WaterLevel.h2
-rw-r--r--src/rw/VisibilityPlugins.cpp3
-rw-r--r--src/save/GenericGameStorage.cpp2
-rw-r--r--src/skel/glfw/glfw.cpp2
-rw-r--r--src/vehicles/Automobile.cpp9
-rw-r--r--src/vehicles/Boat.cpp1
-rw-r--r--src/vehicles/DamageManager.cpp1
-rw-r--r--src/vehicles/Heli.cpp4
-rw-r--r--src/vehicles/Train.cpp2
-rw-r--r--src/vehicles/Train.h2
-rw-r--r--src/weapons/BulletInfo.cpp1
-rw-r--r--src/weapons/ProjectileInfo.cpp3
-rw-r--r--src/weapons/Weapon.cpp8
-rw-r--r--src/weapons/WeaponInfo.cpp10
49 files changed, 146 insertions, 61 deletions
diff --git a/src/animation/AnimBlendAssociation.h b/src/animation/AnimBlendAssociation.h
index 7efd8099..fe9b18e0 100644
--- a/src/animation/AnimBlendAssociation.h
+++ b/src/animation/AnimBlendAssociation.h
@@ -63,7 +63,10 @@ public:
CAnimBlendAssociation(void);
CAnimBlendAssociation(CAnimBlendAssociation &other);
- virtual ~CAnimBlendAssociation(void);
+#ifndef FIX_BUGS
+ virtual
+#endif
+ ~CAnimBlendAssociation(void);
void AllocateAnimBlendNodeArray(int n);
void FreeAnimBlendNodeArray(void);
void Init(RpClump *clump, CAnimBlendHierarchy *hier);
diff --git a/src/animation/FrameUpdate.cpp b/src/animation/FrameUpdate.cpp
index 03e67017..b886e95d 100644
--- a/src/animation/FrameUpdate.cpp
+++ b/src/animation/FrameUpdate.cpp
@@ -148,11 +148,12 @@ FrameUpdateCallBackWithVelocityExtractionNonSkinned(AnimBlendFrameData *frame, v
mat->pos.x = pos.x - transx;
mat->pos.y = pos.y - transy;
mat->pos.z = pos.z;
- if(mat->pos.z >= -0.8f)
+ if(mat->pos.z >= -0.8f) {
if(mat->pos.z < -0.4f)
mat->pos.z += (2.5f * mat->pos.z + 2.0f) * frame->resetPos.z;
else
mat->pos.z += frame->resetPos.z;
+ }
mat->pos.x += frame->resetPos.x;
mat->pos.y += frame->resetPos.y;
}
@@ -356,11 +357,12 @@ FrameUpdateCallBackWithVelocityExtractionSkinned(AnimBlendFrameData *frame, void
xform->t.x = pos.x - transx;
xform->t.y = pos.y - transy;
xform->t.z = pos.z;
- if(xform->t.z >= -0.8f)
+ if(xform->t.z >= -0.8f) {
if(xform->t.z < -0.4f)
xform->t.z += (2.5f * xform->t.z + 2.0f) * frame->resetPos.z;
else
xform->t.z += frame->resetPos.z;
+ }
xform->t.x += frame->resetPos.x;
xform->t.y += frame->resetPos.y;
}
diff --git a/src/audio/oal/aldlist.cpp b/src/audio/oal/aldlist.cpp
index 768ace30..458b7c80 100644
--- a/src/audio/oal/aldlist.cpp
+++ b/src/audio/oal/aldlist.cpp
@@ -53,7 +53,7 @@ ALDeviceList::ALDeviceList()
index = 0;
// go through device list (each device terminated with a single NULL, list terminated with double NULL)
- while (*devices != NULL) {
+ while (*devices != '\0') {
if (strcmp(defaultDeviceName, devices) == 0) {
defaultDeviceIndex = index;
}
@@ -186,7 +186,7 @@ unsigned int ALDeviceList::GetMaxNumSources(int index)
/*
* Checks if the extension is supported on the given device
*/
-bool ALDeviceList::IsExtensionSupported(int index, char *szExtName)
+bool ALDeviceList::IsExtensionSupported(int index, const char *szExtName)
{
bool bReturn = false;
diff --git a/src/audio/oal/aldlist.h b/src/audio/oal/aldlist.h
index b8f1b31a..694c9d01 100644
--- a/src/audio/oal/aldlist.h
+++ b/src/audio/oal/aldlist.h
@@ -32,7 +32,7 @@ public:
char *GetDeviceName(int index);
void GetDeviceVersion(int index, int *major, int *minor);
unsigned int GetMaxNumSources(int index);
- bool IsExtensionSupported(int index, char *szExtName);
+ bool IsExtensionSupported(int index, const char *szExtName);
int GetDefaultDevice();
void FilterDevicesMinVer(int major, int minor);
void FilterDevicesMaxVer(int major, int minor);
@@ -46,4 +46,4 @@ private:
};
#endif
-#endif // ALDEVICELIST_H \ No newline at end of file
+#endif // ALDEVICELIST_H
diff --git a/src/control/CarAI.cpp b/src/control/CarAI.cpp
index c233178f..0f80954b 100644
--- a/src/control/CarAI.cpp
+++ b/src/control/CarAI.cpp
@@ -461,6 +461,7 @@ void CCarAI::UpdateCarAI(CVehicle* pVehicle)
}
}
break;
+ default: break;
}
}
if (pVehicle->pDriver && pVehicle->pDriver->m_objective == OBJECTIVE_KILL_CHAR_ANY_MEANS){
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 833bd192..963ef693 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2671,6 +2671,7 @@ void CCarCtrl::SteerAICarWithPhysicsFollowPath(CVehicle* pVehicle, float* pSwerv
SteerAICarWithPhysicsHeadingForTarget(pVehicle, nil, pVehicle->AutoPilot.m_vecDestinationCoors.x,
pVehicle->AutoPilot.m_vecDestinationCoors.y, pSwerve, pAccel, pBrake, pHandbrake);
return;
+ default: break;
}
}
pCurrentLink = &ThePaths.m_carPathLinks[pVehicle->AutoPilot.m_nCurrentPathNodeInfo];
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index b72931c6..82003561 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -533,6 +533,7 @@ void CGarage::Update()
case GARAGE_BOMBSHOP1: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB1_SET, 1); break;
case GARAGE_BOMBSHOP2: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB2_SET, 1); break;
case GARAGE_BOMBSHOP3: DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB3_SET, 1); break;
+ default: break;
}
m_eGarageState = GS_OPENING;
if (!CGarages::BombsAreFree)
@@ -577,6 +578,7 @@ void CGarage::Update()
case GARAGE_BOMBSHOP3:
CHud::SetHelpMessage(TheText.Get("GA_8"), false); // Use the detonator to activate the bomb.
break;
+ default: break;
}
CPad::GetPad(0)->SetEnablePlayerControls(PLAYERCONTROL_GARAGE);
FindPlayerPed()->m_pWanted->m_bIgnoredByCops = false;
@@ -2064,6 +2066,7 @@ bool CGarages::IsPointWithinHideOutGarage(Const CVector& point)
case GARAGE_HIDEOUT_THREE:
if (aGarages[i].IsPointInsideGarage(point))
return true;
+ default: break;
}
}
return false;
diff --git a/src/control/Pickups.cpp b/src/control/Pickups.cpp
index 59b8b5c2..330b5788 100644
--- a/src/control/Pickups.cpp
+++ b/src/control/Pickups.cpp
@@ -356,6 +356,7 @@ CPickup::Update(CPlayerPed *player, CVehicle *vehicle, int playerId)
return true;
}
break;
+ default: break;
}
}
if (!m_bRemoved && (m_eType == PICKUP_ONCE_TIMEOUT || m_eType == PICKUP_MONEY) && CTimer::GetTimeInMilliseconds() > m_nTimer)
@@ -576,6 +577,7 @@ CPickups::ModelForWeapon(eWeaponType weaponType)
case WEAPONTYPE_FLAMETHROWER: return MI_FLAMETHROWER;
case WEAPONTYPE_MOLOTOV: return MI_MOLOTOV;
case WEAPONTYPE_GRENADE: return MI_GRENADE;
+ default: break;
}
return 0;
}
diff --git a/src/control/SceneEdit.cpp b/src/control/SceneEdit.cpp
index 1b6292b8..f7dcaa3c 100644
--- a/src/control/SceneEdit.cpp
+++ b/src/control/SceneEdit.cpp
@@ -303,7 +303,7 @@ void CSceneEdit::Draw(void)
nCommandDrawn -= (MOVIE_TOTAL_COMMANDS - 1);
if (nCommandDrawn <= MOVIE_DO_NOTHING)
nCommandDrawn += (MOVIE_TOTAL_COMMANDS - 1);
- sprintf(str, pCommandStrings[nCommandDrawn]);
+ sprintf(str, "%s", pCommandStrings[nCommandDrawn]);
AsciiToUnicode(str, wstr);
CFont::SetColor(CRGBA(0, 0, 0, 0));
CFont::PrintString(SCREEN_SCALE_FROM_RIGHT(COMMAND_NAME_X_RIGHT - SHADOW_OFFSET), SCREEN_SCALE_Y(COMMAND_NAME_Y + SHADOW_OFFSET + i * COMMAND_NAME_HEIGHT), wstr);
@@ -1095,4 +1095,4 @@ bool CSceneEdit::SelectWeapon(void)
return false;
}
return false;
-} \ No newline at end of file
+}
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index ccfc010e..50dc6b7b 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -11777,6 +11777,7 @@ INITSAVEBUF
case ENTITY_TYPE_DUMMY:
type = 4;
handle = CPools::GetDummyPool()->GetJustIndex((CDummy*)pEntity) + 1;
+ default: break;
}
}
WriteSaveBuf(buf, type);
@@ -11934,6 +11935,7 @@ void CTheScripts::ClearSpaceForMissionEntity(const CVector& pos, CEntity* pEntit
printf("Deleted a ped where a mission entity should be\n");
break;
}
+ default: break;
}
}
}
diff --git a/src/core/AnimViewer.cpp b/src/core/AnimViewer.cpp
index 4092a210..35106a6b 100644
--- a/src/core/AnimViewer.cpp
+++ b/src/core/AnimViewer.cpp
@@ -120,7 +120,7 @@ CAnimViewer::Initialise(void) {
if (!CFileMgr::ReadLine(fd, gString, 255))
break;
- sscanf(gString, "%s %s", &modelName, &animGroup);
+ sscanf(gString, "%s %s", modelName, animGroup);
int groupId;
for (groupId = 0; groupId < NUM_ANIM_ASSOC_GROUPS; groupId++) {
if (!strcmp(animGroup, CAnimManager::GetAnimGroupName((AssocGroupId)groupId)))
@@ -423,4 +423,4 @@ CAnimViewer::Shutdown(void)
CTimer::Shutdown();
CStreaming::Shutdown();
CTxdStore::RemoveTxdSlot(animTxdSlot);
-} \ No newline at end of file
+}
diff --git a/src/core/Cam.cpp b/src/core/Cam.cpp
index 30336423..b6d46580 100644
--- a/src/core/Cam.cpp
+++ b/src/core/Cam.cpp
@@ -885,7 +885,7 @@ CCam::PrintMode(void)
sprintf(buf, " ");
sprintf(buf, " ");
- static char *modes[] = { "None",
+ static Const char *modes[] = { "None",
"Top Down", "GTA Classic", "Behind Car", "Follow Ped",
"Aiming", "Debug", "Sniper", "Rocket", "Model Viewer", "Bill",
"Syphon", "Circle", "Cheesy Zoom", "Wheel", "Fixed",
diff --git a/src/core/Camera.cpp b/src/core/Camera.cpp
index ffaa5884..623b2ea9 100644
--- a/src/core/Camera.cpp
+++ b/src/core/Camera.cpp
@@ -80,6 +80,10 @@ CCamera::CCamera(void)
Init();
}
+CCamera::CCamera(float)
+{
+}
+
void
CCamera::Init(void)
{
@@ -87,7 +91,12 @@ CCamera::Init(void)
float fMouseAccelHorzntl = m_fMouseAccelHorzntl;
float fMouseAccelVertical = m_fMouseAccelVertical;
#endif
+#ifdef FIX_BUGS
+ static const CCamera DummyCamera = CCamera(0.f);
+ *this = DummyCamera;
+#else
memset(this, 0, sizeof(CCamera)); // getting rid of vtable, eh?
+#endif
#ifdef GTA3_1_1_PATCH
m_fMouseAccelHorzntl = fMouseAccelHorzntl;
m_fMouseAccelVertical = fMouseAccelVertical;
@@ -744,6 +753,7 @@ CCamera::CamControl(void)
case VEHICLE_TYPE_BOAT:
ReqMode = CCam::MODE_BEHINDBOAT;
break;
+ default: break;
}
// Car zoom value
@@ -2991,7 +3001,7 @@ CCamera::SetZoomValueFollowPedScript(int16 dist)
case 0: m_fPedZoomValueScript = 0.25f; break;
case 1: m_fPedZoomValueScript = 1.5f; break;
case 2: m_fPedZoomValueScript = 2.9f; break;
- default: m_fPedZoomValueScript = m_fPedZoomValueScript; break;
+ default: break;
}
m_bUseScriptZoomValuePed = true;
@@ -3006,7 +3016,7 @@ CCamera::SetZoomValueCamStringScript(int16 dist)
case 0: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_1 : FREE_CAR_ZOOM_VALUE_1; break;
case 1: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_2 : FREE_CAR_ZOOM_VALUE_2; break;
case 2: m_fCarZoomValueScript = ((CVehicle*)Cams[ActiveCam].CamTargetEntity)->IsBoat() ? FREE_BOAT_ZOOM_VALUE_3 : FREE_CAR_ZOOM_VALUE_3; break;
- default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
+ default: break;
}
} else
#endif
@@ -3015,7 +3025,7 @@ CCamera::SetZoomValueCamStringScript(int16 dist)
case 0: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_1; break;
case 1: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_2; break;
case 2: m_fCarZoomValueScript = DEFAULT_CAR_ZOOM_VALUE_3; break;
- default: m_fCarZoomValueScript = m_fCarZoomValueScript; break;
+ default: break;
}
}
diff --git a/src/core/Camera.h b/src/core/Camera.h
index 94bcbd23..80fc878e 100644
--- a/src/core/Camera.h
+++ b/src/core/Camera.h
@@ -403,7 +403,7 @@ public:
int m_BlurRed;
int m_BlurType;
-uint32 unknown; // some counter having to do with music
+ uint32 unknown; // some counter having to do with music
int m_iWorkOutSpeedThisNumFrames;
int m_iNumFramesSoFar;
@@ -549,6 +549,7 @@ uint32 unknown; // some counter having to do with music
// High level and misc
CCamera(void);
+ CCamera(float);
void Init(void);
void Process(void);
void CamControl(void);
diff --git a/src/core/Collision.cpp b/src/core/Collision.cpp
index 48abbd9a..c29c1d28 100644
--- a/src/core/Collision.cpp
+++ b/src/core/Collision.cpp
@@ -112,7 +112,7 @@ CCollision::SortOutCollisionAfterLoad(void)
void
CCollision::LoadCollisionScreen(eLevelName level)
{
- static char *levelNames[4] = {
+ static Const char *levelNames[4] = {
"",
"IND_ZON",
"COM_ZON",
diff --git a/src/core/ControllerConfig.cpp b/src/core/ControllerConfig.cpp
index dcd9f125..6a5080e5 100644
--- a/src/core/ControllerConfig.cpp
+++ b/src/core/ControllerConfig.cpp
@@ -610,6 +610,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonDown(int32 button,
case MOUSE:
state = &CPad::GetPad(PAD1)->PCTempMouseState;
break;
+ default: break;
}
if (pad != NULL)
@@ -1024,7 +1025,7 @@ void CControllerConfigManager::AffectControllerStateOn_ButtonUp(int32 button, eC
case JOYSTICK:
state = &CPad::GetPad(PAD1)->PCTempJoyState;
break;
-
+ default: break;
}
if (process)
@@ -1293,6 +1294,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetApps())
return true;
break;
+ default: break;
}
return false;
@@ -1493,6 +1495,7 @@ bool CControllerConfigManager::GetIsKeyboardKeyJustDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetAppsJustDown())
return true;
break;
+ default: break;
}
return false;
@@ -1530,6 +1533,7 @@ bool CControllerConfigManager::GetIsMouseButtonDown(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2())
return true;
break;
+ default: break;
}
return false;
@@ -1567,6 +1571,7 @@ bool CControllerConfigManager::GetIsMouseButtonUp(RsKeyCodes keycode)
if (CPad::GetPad(PAD1)->GetMouseX2Up())
return true;
break;
+ default: break;
}
return false;
@@ -1747,6 +1752,7 @@ void CControllerConfigManager::DeleteMatchingActionInitiators(e_ControllerAction
DeleteMatchingCommonControls (action, key, type);
DeleteMatching1rst3rdPersonControls (action, key, type);
break;
+ default: break;
}
}
}
@@ -1770,6 +1776,7 @@ bool CControllerConfigManager::GetIsKeyBlank(int32 key, eControllerType type)
if (key != 0)
return false;
break;
+ default: break;
}
return true;
@@ -1836,6 +1843,7 @@ e_ControllerActionType CControllerConfigManager::GetActionType(e_ControllerActio
case PED_SNIPER_ZOOM_OUT:
return ACTIONTYPE_1RSTPERSON;
break;
+ default: break;
}
return ACTIONTYPE_NONE;
@@ -1861,6 +1869,7 @@ void CControllerConfigManager::ClearSettingsAssociatedWithAction(e_ControllerAct
m_aSettings[action][type].m_Key = 0;
m_aSettings[action][type].m_ContSetOrder = SETORDER_NONE;
break;
+ default: break;
}
ResetSettingOrder(action);
@@ -1881,6 +1890,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextWithOrderNumber(e_Contr
return GetControllerSettingTextMouse (action);
case JOYSTICK:
return GetControllerSettingTextJoystick(action);
+ default: break;
}
}
}
@@ -2224,6 +2234,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextKeyBoard(e_ControllerAc
return TheText.Get("FEC_SFT"); // "SHIFT"
break;
}
+ default: break;
}
}
}
@@ -2256,6 +2267,7 @@ wchar *CControllerConfigManager::GetControllerSettingTextMouse(e_ControllerActio
case 7:
return TheText.Get("FEC_MXT"); // MXB2
break;
+ default: break;
}
return NULL;
@@ -2375,6 +2387,7 @@ bool CControllerConfigManager::GetIsActionAButtonCombo(e_ControllerAction action
case PED_CYCLE_TARGET_RIGHT:
return true;
break;
+ default: break;
}
return false;
@@ -2395,6 +2408,7 @@ wchar *CControllerConfigManager::GetButtonComboText(e_ControllerAction action)
case VEHICLE_LOOKBEHIND:
return TheText.Get("FEC_LBC"); // Use Look Left With Look Right.
break;
+ default: break;
}
return NULL;
diff --git a/src/core/FileLoader.cpp b/src/core/FileLoader.cpp
index 09c62c35..a78bf635 100644
--- a/src/core/FileLoader.cpp
+++ b/src/core/FileLoader.cpp
@@ -783,7 +783,7 @@ CFileLoader::LoadClumpObject(const char *line)
char model[24], txd[24];
CClumpModelInfo *mi;
- if(sscanf(line, "%d %s %s", &id, &model, &txd) == 3){
+ if(sscanf(line, "%d %s %s", &id, model, txd) == 3){
mi = CModelInfo::AddClumpModel(id);
mi->SetName(model);
mi->SetTexDictionary(txd);
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index e313bee8..d27a98ec 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -412,7 +412,7 @@ CMenuManager::ThingsToDoBeforeLeavingPage()
// ------ Functions not in the game/inlined ends
void
-CMenuManager::BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2)
+CMenuManager::BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2)
{
if (!text)
return;
@@ -5020,6 +5020,7 @@ CMenuManager::SaveLoadFileError_SetUpErrorScreen()
case SAVESTATUS_DELETEFAILED10:
ChangeScreen(MENUPAGE_DELETE_FAILED, 0, true, false);
break;
+ default: break;
}
}
diff --git a/src/core/Frontend.h b/src/core/Frontend.h
index 5c713f53..16da5cb1 100644
--- a/src/core/Frontend.h
+++ b/src/core/Frontend.h
@@ -598,7 +598,7 @@ public:
#endif
public:
- static void BuildStatLine(char *text, void *stat, bool itsFloat, void *stat2);
+ static void BuildStatLine(Const char *text, void *stat, bool itsFloat, void *stat2);
static void CentreMousePointer();
void CheckCodesForControls(int);
bool CheckHover(int x1, int x2, int y1, int y2);
diff --git a/src/core/Pad.cpp b/src/core/Pad.cpp
index 8e9858ce..f6685388 100644
--- a/src/core/Pad.cpp
+++ b/src/core/Pad.cpp
@@ -523,7 +523,7 @@ CMouseControllerState CMousePointerStateHelper::GetMouseSetUp()
double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
- if (xpos != NULL) {
+ if (xpos != 0.f) {
state.MMB = true;
state.RMB = true;
state.LMB = true;
@@ -579,7 +579,7 @@ void CPad::UpdateMouse()
#else
double xpos = 1.0f, ypos;
glfwGetCursorPos(PSGLOBAL(window), &xpos, &ypos);
- if (xpos == NULL)
+ if (xpos == 0.f)
return;
int32 signX = 1;
diff --git a/src/core/Pools.cpp b/src/core/Pools.cpp
index bc65f6b6..b361c36f 100644
--- a/src/core/Pools.cpp
+++ b/src/core/Pools.cpp
@@ -90,7 +90,11 @@ CPools::MakeSureSlotInObjectPoolIsEmpty(int32 slot)
// relocate to another slot??
CObject *newObject = new CObject(object->GetModelIndex(), false);
CWorld::Remove(object);
+#ifdef FIX_BUGS
+ *newObject = *object;
+#else
memcpy(newObject, object, ms_pObjectPool->GetMaxEntrySize());
+#endif
CWorld::Add(newObject);
object->m_rwObject = nil;
delete object;
diff --git a/src/core/Profile.cpp b/src/core/Profile.cpp
index 05d54133..0aa18ab8 100644
--- a/src/core/Profile.cpp
+++ b/src/core/Profile.cpp
@@ -7,7 +7,7 @@ float CProfile::ms_afCumulativeTime[NUM_PROFILES];
float CProfile::ms_afEndTime[NUM_PROFILES];
float CProfile::ms_afMaxEndTime[NUM_PROFILES];
float CProfile::ms_afMaxCumulativeTime[NUM_PROFILES];
-char *CProfile::ms_pProfileString[NUM_PROFILES];
+Const char *CProfile::ms_pProfileString[NUM_PROFILES];
RwRGBA CProfile::ms_aBarColours[NUM_PROFILES];
void CProfile::Initialise()
@@ -68,4 +68,4 @@ void CProfile::ShowResults()
ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME] = Max(ms_afMaxCumulativeTime[PROFILE_RENDERING_TIME], ms_afCumulativeTime[PROFILE_RENDERING_TIME]);
ms_afMaxCumulativeTime[PROFILE_TOTAL] = Max(ms_afMaxCumulativeTime[PROFILE_TOTAL], ms_afCumulativeTime[PROFILE_TOTAL]);
}
-#endif \ No newline at end of file
+#endif
diff --git a/src/core/Profile.h b/src/core/Profile.h
index d2e8054b..4fe693ae 100644
--- a/src/core/Profile.h
+++ b/src/core/Profile.h
@@ -19,10 +19,10 @@ class CProfile
static float ms_afEndTime[NUM_PROFILES];
static float ms_afMaxEndTime[NUM_PROFILES];
static float ms_afMaxCumulativeTime[NUM_PROFILES];
- static char *ms_pProfileString[NUM_PROFILES];
+ static Const char *ms_pProfileString[NUM_PROFILES];
static RwRGBA ms_aBarColours[NUM_PROFILES];
public:
static void Initialise();
static void SuspendProfile(eProfile profile);
static void ShowResults();
-}; \ No newline at end of file
+};
diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp
index d2c4c9b0..03a7757a 100644
--- a/src/core/Streaming.cpp
+++ b/src/core/Streaming.cpp
@@ -804,6 +804,7 @@ CStreaming::RequestIslands(eLevelName level)
if(islandLODmainland != -1)
RequestModel(islandLODmainland, BIGBUILDINGFLAGS);
break;
+ default: break;
}
}
@@ -1919,7 +1920,7 @@ CStreaming::ProcessLoadingChannel(int32 ch)
void
CStreaming::RetryLoadFile(int32 ch)
{
- char *key;
+ Const char *key;
CPad::StopPadsShaking();
diff --git a/src/core/SurfaceTable.cpp b/src/core/SurfaceTable.cpp
index 7212fc65..08a84cfd 100644
--- a/src/core/SurfaceTable.cpp
+++ b/src/core/SurfaceTable.cpp
@@ -9,7 +9,7 @@
float CSurfaceTable::ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
void
-CSurfaceTable::Initialise(char *filename)
+CSurfaceTable::Initialise(Const char *filename)
{
int lineno, fieldno;
char *line;
diff --git a/src/core/SurfaceTable.h b/src/core/SurfaceTable.h
index 4af6a265..12246dce 100644
--- a/src/core/SurfaceTable.h
+++ b/src/core/SurfaceTable.h
@@ -100,7 +100,7 @@ class CSurfaceTable
{
static float ms_aAdhesiveLimitTable[NUMADHESIVEGROUPS][NUMADHESIVEGROUPS];
public:
- static void Initialise(char *filename);
+ static void Initialise(Const char *filename);
static int GetAdhesionGroup(uint8 surfaceType);
static float GetWetMultiplier(uint8 surfaceType);
static float GetAdhesiveLimit(CColPoint &colpoint);
diff --git a/src/core/World.cpp b/src/core/World.cpp
index 6ea3489b..493ce042 100644
--- a/src/core/World.cpp
+++ b/src/core/World.cpp
@@ -2212,6 +2212,7 @@ CWorld::TriggerExplosionSectorList(CPtrList &list, const CVector &position, floa
case ENTITY_TYPE_OBJECT:
pObject->ObjectDamage(300.0f * fDamageMultiplier);
break;
+ default: break;
}
}
}
diff --git a/src/core/main.cpp b/src/core/main.cpp
index 14c854bd..dc61f03f 100644
--- a/src/core/main.cpp
+++ b/src/core/main.cpp
@@ -401,7 +401,7 @@ DestroySplashScreen(void)
splashTxdId = -1;
}
-char*
+Const char*
GetRandomSplashScreen(void)
{
int index;
@@ -424,10 +424,10 @@ GetRandomSplashScreen(void)
return splashName;
}
-char*
+Const char*
GetLevelSplashScreen(int level)
{
- static char *splashScreens[4] = {
+ static Const char *splashScreens[4] = {
nil,
"splash1",
"splash2",
@@ -1281,7 +1281,7 @@ void TheGame(void)
CGame::Initialise("DATA\\GTA3.DAT");
#endif
- char *splash = GetRandomSplashScreen(); // inlined here
+ Const char *splash = GetRandomSplashScreen(); // inlined here
LoadingScreen("Starting Game", NULL, splash);
@@ -1315,7 +1315,7 @@ void TheGame(void)
if (FrontEndMenuManager.m_bWantToLoad)
#endif
{
- char *splash1 = GetLevelSplashScreen(CGame::currLevel);
+ Const char *splash1 = GetLevelSplashScreen(CGame::currLevel);
LoadSplash(splash1);
}
diff --git a/src/core/main.h b/src/core/main.h
index 90b13fbb..32a880d6 100644
--- a/src/core/main.h
+++ b/src/core/main.h
@@ -22,8 +22,8 @@ void LoadingScreen(const char *str1, const char *str2, const char *splashscreen)
void LoadingIslandScreen(const char *levelName);
CSprite2d *LoadSplash(const char *name);
void DestroySplashScreen(void);
-char *GetLevelSplashScreen(int level);
-char *GetRandomSplashScreen(void);
+Const char *GetLevelSplashScreen(int level);
+Const char *GetRandomSplashScreen(void);
void LittleTest(void);
void ValidateVersion();
void ResetLoadingScreenBar(void);
diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp
index 57176561..bf81bd8a 100644
--- a/src/modelinfo/PedModelInfo.cpp
+++ b/src/modelinfo/PedModelInfo.cpp
@@ -50,7 +50,7 @@ CPedModelInfo::SetClump(RpClump *clump)
struct ColNodeInfo
{
- char *name;
+ Const char *name;
int pedNode;
int pieceType;
float x, z;
diff --git a/src/objects/ParticleObject.cpp b/src/objects/ParticleObject.cpp
index 3dd80546..2fbe6195 100644
--- a/src/objects/ParticleObject.cpp
+++ b/src/objects/ParticleObject.cpp
@@ -61,7 +61,7 @@ CParticleObject::CParticleObject() :
m_nState(POBJECTSTATE_INITIALISED),
m_pNext(NULL),
m_pPrev(NULL),
- m_nRemoveTimer(NULL)
+ m_nRemoveTimer(0)
{
;
@@ -1127,13 +1127,21 @@ CParticleObject::SaveParticle(uint8 *buffer, uint32 *length)
for ( CParticleObject *p = pCloseListHead; p != NULL; p = p->m_pNext )
{
+#ifdef FIX_BUGS
+ *(CParticleObject*)buffer = *p;
+#else
memcpy(buffer, p, sizeof(CParticleObject));
+#endif
buffer += sizeof(CParticleObject);
}
for ( CParticleObject *p = pFarListHead; p != NULL; p = p->m_pNext )
{
+#ifdef FIX_BUGS
+ *(CParticleObject*)buffer = *p;
+#else
memcpy(buffer, p, sizeof(CParticleObject));
+#endif
buffer += sizeof(CParticleObject);
}
diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp
index 38ea4bef..2cb36843 100644
--- a/src/peds/EmergencyPed.cpp
+++ b/src/peds/EmergencyPed.cpp
@@ -163,6 +163,7 @@ CEmergencyPed::FiremanAI(void)
m_nEmergencyPedState = EMERGENCY_PED_READY;
SetMoveState(PEDMOVE_WALK);
break;
+ default: break;
}
}
@@ -407,6 +408,7 @@ CEmergencyPed::MedicAI(void)
m_nEmergencyPedState = EMERGENCY_PED_READY;
SetMoveState(PEDMOVE_WALK);
break;
+ default: break;
}
}
}
diff --git a/src/peds/Ped.cpp b/src/peds/Ped.cpp
index 8cf52e91..91b74b96 100644
--- a/src/peds/Ped.cpp
+++ b/src/peds/Ped.cpp
@@ -5056,13 +5056,13 @@ CPed::LoadFightData(void)
sscanf(
&line[lp],
"%s %f %f %f %f %c %s %d %d",
- &moveName,
+ moveName,
&startFireTime,
&endFireTime,
&comboFollowOnTime,
&strikeRadius,
&hitLevel,
- &animName,
+ animName,
&damage,
&flags);
@@ -10617,6 +10617,7 @@ CPed::ProcessControl(void)
Say(SOUND_PED_HANDS_UP);
}
break;
+ default: break;
}
SetMoveAnim();
if (bPedIsBleeding) {
@@ -11741,8 +11742,10 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
}
} else if (ped->m_objective == OBJECTIVE_ENTER_CAR_AS_PASSENGER) {
- switch (ped->m_vehEnterType) {
- if (!veh->bIsBus) {
+ if (veh->bIsBus) {
+ veh->AddPassenger(ped);
+ } else {
+ switch (ped->m_vehEnterType) {
case CAR_DOOR_RF:
veh->AddPassenger(ped, 0);
break;
@@ -11752,10 +11755,10 @@ CPed::PedSetInCarCB(CAnimBlendAssociation *animAssoc, void *arg)
case CAR_DOOR_LR:
veh->AddPassenger(ped, 1);
break;
- }
- default:
- veh->AddPassenger(ped);
+ default:
+ veh->AddPassenger(ped);
break;
+ }
}
ped->m_nPedState = PED_DRIVING;
if (ped->m_prevObjective == OBJECTIVE_RUN_TO_AREA || ped->m_prevObjective == OBJECTIVE_GOTO_CHAR_ON_FOOT || ped->m_prevObjective == OBJECTIVE_KILL_CHAR_ON_FOOT)
@@ -17002,6 +17005,7 @@ CPed::SetObjective(eObjective newObj, CVector dest)
if (sq(m_distanceToCountSeekDone) > (m_nextRoutePointPos - GetPosition()).MagnitudeSqr2D())
return;
break;
+ default: break;
}
if (IsTemporaryObjective(m_objective)) {
diff --git a/src/render/Particle.cpp b/src/render/Particle.cpp
index 3babbe44..e73cd9a7 100644
--- a/src/render/Particle.cpp
+++ b/src/render/Particle.cpp
@@ -984,6 +984,7 @@ CParticle *CParticle::AddParticle(tParticleType type, CVector const &vecPos, CVe
case PARTICLE_WATER_HYDRANT:
pParticle->m_vecPosition.z += 20.0f * psystem->m_fPositionRandomError * ms_afRandTable[CGeneral::GetRandomNumber() % RAND_TABLE_SIZE];
break;
+ default: break;
}
if ( fSize != 0.0f )
@@ -1214,6 +1215,7 @@ void CParticle::Update()
continue;
}
break;
+ default: break;
}
}
}
@@ -1295,6 +1297,7 @@ void CParticle::Update()
continue;
}
break;
+ default: break;
}
}
}
diff --git a/src/render/WaterLevel.cpp b/src/render/WaterLevel.cpp
index 66debd68..f1ccccb3 100644
--- a/src/render/WaterLevel.cpp
+++ b/src/render/WaterLevel.cpp
@@ -49,7 +49,7 @@ const float fBlueMult = 1.4f;
void
-CWaterLevel::Initialise(char *pWaterDat)
+CWaterLevel::Initialise(Const char *pWaterDat)
{
ms_nNoOfWaterLevels = 0;
diff --git a/src/render/WaterLevel.h b/src/render/WaterLevel.h
index 2fe2e103..435692c1 100644
--- a/src/render/WaterLevel.h
+++ b/src/render/WaterLevel.h
@@ -81,7 +81,7 @@ class CWaterLevel
static int16 nGeomUsed;
public:
- static void Initialise(char *pWaterDat);
+ static void Initialise(Const char *pWaterDat);
static void Shutdown();
static void CreateWavyAtomic();
static void DestroyWavyAtomic();
diff --git a/src/rw/VisibilityPlugins.cpp b/src/rw/VisibilityPlugins.cpp
index 5639fbbd..5a94e8f6 100644
--- a/src/rw/VisibilityPlugins.cpp
+++ b/src/rw/VisibilityPlugins.cpp
@@ -295,7 +295,7 @@ CVisibilityPlugins::RenderFadingAtomic(RpAtomic *atomic, float camdist)
{
RpAtomic *lodatm;
float fadefactor;
- uint8 alpha;
+ uint32 alpha;
CSimpleModelInfo *mi;
mi = GetAtomicModelInfo(atomic);
@@ -889,6 +889,7 @@ CVisibilityPlugins::SetClumpModelInfo(RpClump *clump, CClumpModelInfo *modelInfo
else
CLUMPEXT(clump)->visibilityCB = VehicleVisibilityCB;
break;
+ default: break;
}
}
diff --git a/src/save/GenericGameStorage.cpp b/src/save/GenericGameStorage.cpp
index cba409c0..1afa8165 100644
--- a/src/save/GenericGameStorage.cpp
+++ b/src/save/GenericGameStorage.cpp
@@ -246,7 +246,7 @@ GenericLoad()
// Load SimpleVars and Scripts
CheckSum = 0;
- CDate(CompileDateAndTime);
+ CDate dummy; // unused
CPad::ResetCheats();
if (!ReadInSizeofSaveFileBuffer(file, size))
return false;
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp
index f5f1c11e..e74e83dd 100644
--- a/src/skel/glfw/glfw.cpp
+++ b/src/skel/glfw/glfw.cpp
@@ -429,7 +429,7 @@ RwChar **_psGetVideoModeList()
if ( vm.flags & rwVIDEOMODEEXCLUSIVE )
{
_VMList[i] = (RwChar*)RwCalloc(100, sizeof(RwChar));
- rwsprintf(_VMList[i],"%lu X %lu X %lu", vm.width, vm.height, vm.depth);
+ rwsprintf(_VMList[i],"%d X %d X %d", vm.width, vm.height, vm.depth);
}
else
_VMList[i] = nil;
diff --git a/src/vehicles/Automobile.cpp b/src/vehicles/Automobile.cpp
index 50eec49f..ecf821bc 100644
--- a/src/vehicles/Automobile.cpp
+++ b/src/vehicles/Automobile.cpp
@@ -248,6 +248,7 @@ CAutomobile::ProcessControl(void)
strongGrip2 = true;
}
}
+ default: break;
}
}
@@ -419,6 +420,7 @@ CAutomobile::ProcessControl(void)
m_fGasPedal = 0.0f;
m_nCarHornTimer = 0;
break;
+ default: break;
}
// what's going on here?
@@ -1252,6 +1254,7 @@ CAutomobile::PreRender(void)
m_aWheelColPoints[i].point + CVector(0.0f, 0.0f, 0.05f),
CVector(0.0f, 0.0f, 0.0f), nil, 0.1f);
break;
+ default: break;
}
}
}else{
@@ -1376,6 +1379,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_LEFT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_LEFT]);
break;
+ default: break;
}
switch(m_aWheelState[CARWHEEL_REAR_RIGHT]){
@@ -1393,6 +1397,7 @@ CAutomobile::PreRender(void)
GetForward().x, GetForward().y,
&m_aWheelSkidmarkMuddy[CARWHEEL_REAR_RIGHT], &m_aWheelSkidmarkBloody[CARWHEEL_REAR_RIGHT]);
break;
+ default: break;
}
}
@@ -1845,7 +1850,7 @@ CAutomobile::PreRender(void)
false);
CVector pos = GetPosition() - 4.0f*GetForward();
if(Damage.GetLightStatus(VEHLIGHT_REAR_LEFT) == LIGHT_STATUS_OK ||
- Damage.GetLightStatus(VEHLIGHT_REAR_RIGHT) == LIGHT_STATUS_OK)
+ Damage.GetLightStatus(VEHLIGHT_REAR_RIGHT) == LIGHT_STATUS_OK) {
if(m_fBrakePedal > 0.0f)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f),
10.0f, 1.0f, 0.0f, 0.0f,
@@ -1854,6 +1859,7 @@ CAutomobile::PreRender(void)
CPointLights::AddLight(CPointLights::LIGHT_POINT, pos, CVector(0.0f, 0.0f, 0.0f),
7.0f, 0.6f, 0.0f, 0.0f,
CPointLights::FOG_NONE, false);
+ }
}
}else{
// Lights off
@@ -3775,6 +3781,7 @@ CAutomobile::IsDoorReady(eDoors door)
case DOOR_FRONT_RIGHT: doorflag = CAR_DOOR_FLAG_RF; break;
case DOOR_REAR_LEFT: doorflag = CAR_DOOR_FLAG_LR; break;
case DOOR_REAR_RIGHT: doorflag = CAR_DOOR_FLAG_RR; break;
+ default: break;
}
return (doorflag & m_nGettingInFlags) == 0;
}
diff --git a/src/vehicles/Boat.cpp b/src/vehicles/Boat.cpp
index 5694651c..2f056b02 100644
--- a/src/vehicles/Boat.cpp
+++ b/src/vehicles/Boat.cpp
@@ -180,6 +180,7 @@ CBoat::ProcessControl(void)
return;
}
break;
+ default: break;
}
float collisionDamage = pHandling->fCollisionDamageMultiplier * m_fDamageImpulse;
diff --git a/src/vehicles/DamageManager.cpp b/src/vehicles/DamageManager.cpp
index 03ccfe77..6b59ccda 100644
--- a/src/vehicles/DamageManager.cpp
+++ b/src/vehicles/DamageManager.cpp
@@ -85,6 +85,7 @@ CDamageManager::ApplyDamage(tComponent component, float damage, float unused)
ProgressEngineDamage();
ProgressPanelDamage(subComp);
break;
+ default: break;
}
return true;
}
diff --git a/src/vehicles/Heli.cpp b/src/vehicles/Heli.cpp
index d9c364d2..5cd6488a 100644
--- a/src/vehicles/Heli.cpp
+++ b/src/vehicles/Heli.cpp
@@ -980,7 +980,7 @@ CHeli::TestRocketCollision(CVector *rocketPos)
for(i = 0; i < NUM_HELIS; i++){
if(pHelis[i] && !pHelis[i]->bExplosionProof && (*rocketPos - pHelis[i]->GetPosition()).MagnitudeSqr() < sq(8.0f)){
- pHelis[i]->m_fAngularSpeed = (CGeneral::GetRandomNumber() < RAND_MAX/2) ? 0.05f : -0.05f;
+ pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
hit = true;
@@ -1007,7 +1007,7 @@ CHeli::TestBulletCollision(CVector *line0, CVector *line1, CVector *bulletPos, i
if(pHelis[i]->m_heliType == HELI_CATALINA && pHelis[i]->m_nBulletDamage > 400 ||
pHelis[i]->m_heliType != HELI_CATALINA && pHelis[i]->m_nBulletDamage > 700){
- pHelis[i]->m_fAngularSpeed = (CGeneral::GetRandomNumber() < RAND_MAX/2) ? 0.05f : -0.05f;
+ pHelis[i]->m_fAngularSpeed = CGeneral::GetRandomTrueFalse() ? 0.05f : -0.05f;
pHelis[i]->m_heliStatus = HELI_STATUS_SHOT_DOWN;
pHelis[i]->m_nExplosionTimer = CTimer::GetTimeInMilliseconds() + 10000;
}
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index fef712e6..5dab70c5 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -514,7 +514,7 @@ CTrain::Shutdown(void)
}
void
-CTrain::ReadAndInterpretTrackFile(char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
+CTrain::ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail)
{
#ifdef GTA_TRAIN
diff --git a/src/vehicles/Train.h b/src/vehicles/Train.h
index e20a08fd..d8ee949d 100644
--- a/src/vehicles/Train.h
+++ b/src/vehicles/Train.h
@@ -87,7 +87,7 @@ public:
static void InitTrains(void);
static void Shutdown(void);
- static void ReadAndInterpretTrackFile(char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
+ static void ReadAndInterpretTrackFile(Const char *filename, CTrainNode **nodes, int16 *numNodes, int32 numStations, float *stationDists,
float *totalLength, float *totalDuration, CTrainInterpolationLine *interpLines, bool rightRail);
static void UpdateTrains(void);
};
diff --git a/src/weapons/BulletInfo.cpp b/src/weapons/BulletInfo.cpp
index 92d98a50..389e7486 100644
--- a/src/weapons/BulletInfo.cpp
+++ b/src/weapons/BulletInfo.cpp
@@ -200,6 +200,7 @@ void CBulletInfo::Update(void)
case ENTITY_TYPE_VEHICLE:
DMAudio.PlayOneShot(((CVehicle*)pHitEntity)->m_audioEntityId, SOUND_WEAPON_HIT_VEHICLE, 1.0f);
break;
+ default: break;
}
}
CGlass::WasGlassHitByBullet(pHitEntity, point.point);
diff --git a/src/weapons/ProjectileInfo.cpp b/src/weapons/ProjectileInfo.cpp
index 8297d953..47bc65ac 100644
--- a/src/weapons/ProjectileInfo.cpp
+++ b/src/weapons/ProjectileInfo.cpp
@@ -116,6 +116,7 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
elasticity = 0.5f;
break;
}
+ default: break;
}
int i = 0;
@@ -137,6 +138,7 @@ CProjectileInfo::AddProjectile(CEntity *entity, eWeaponType weapon, CVector pos,
case WEAPONTYPE_GRENADE:
ms_apProjectile[i] = new CProjectile(MI_GRENADE);
break;
+ default: break;
}
if (ms_apProjectile[i] == nil)
@@ -183,6 +185,7 @@ CProjectileInfo::RemoveNotAdd(CEntity *entity, eWeaponType weaponType, CVector p
case WEAPONTYPE_ROCKETLAUNCHER:
CExplosion::AddExplosion(nil, entity, EXPLOSION_ROCKET, pos, 0);
break;
+ default: break;
}
}
diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp
index 2323f8f7..8ce39ceb 100644
--- a/src/weapons/Weapon.cpp
+++ b/src/weapons/Weapon.cpp
@@ -806,6 +806,7 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource)
break;
}
+ default: break;
}
DoBulletImpact(shooter, victim, fireSource, &target, &point, ahead);
@@ -1070,6 +1071,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
break;
}
+ default: break;
}
}
@@ -1101,6 +1103,7 @@ CWeapon::DoBulletImpact(CEntity *shooter, CEntity *victim,
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point->point);
break;
}
+ default: break;
}
}
else
@@ -1328,6 +1331,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
break;
}
+ default: break;
}
}
@@ -1359,6 +1363,7 @@ CWeapon::FireShotgun(CEntity *shooter, CVector *fireSource)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break;
}
+ default: break;
}
}
else
@@ -1768,6 +1773,7 @@ CWeapon::FireInstantHitFromCar(CAutomobile *shooter, bool left)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break;
}
+ default: break;
}
}
else
@@ -2037,6 +2043,7 @@ CWeapon::Update(int32 audioEntity)
break;
}
+ default: break;
}
}
@@ -2131,6 +2138,7 @@ FireOneInstantHitRound(CVector *source, CVector *target, int32 damage)
PlayOneShotScriptObject(SCRIPT_SOUND_BULLET_HIT_GROUND_3, point.point);
break;
}
+ default: break;
}
}
else
diff --git a/src/weapons/WeaponInfo.cpp b/src/weapons/WeaponInfo.cpp
index aec9c69a..c4ab75d2 100644
--- a/src/weapons/WeaponInfo.cpp
+++ b/src/weapons/WeaponInfo.cpp
@@ -105,8 +105,8 @@ CWeaponInfo::LoadWeaponData(void)
sscanf(
&line[lp],
"%s %s %f %d %d %d %d %f %f %f %f %f %f %f %s %s %f %f %f %f %d %d",
- &weaponName,
- &fireType,
+ weaponName,
+ fireType,
&range,
&firingRate,
&reload,
@@ -119,8 +119,8 @@ CWeaponInfo::LoadWeaponData(void)
&fireOffsetX,
&fireOffsetY,
&fireOffsetZ,
- &animToPlay,
- &anim2ToPlay,
+ animToPlay,
+ anim2ToPlay,
&animLoopStart,
&animLoopEnd,
&delayBetweenAnimAndFire,
@@ -201,4 +201,4 @@ CWeaponInfo::Shutdown(void)
{
debug("Shutting down CWeaponInfo...\n");
debug("CWeaponInfo shut down\n");
-} \ No newline at end of file
+}