mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-26 19:14:15 +01:00
Merge pull request #86 from erorcun/erorcun
Kangaroo cheat and weapon bug fixes
This commit is contained in:
commit
b2d1433392
30
src/Pad.cpp
30
src/Pad.cpp
@ -14,6 +14,7 @@
|
||||
#include "Game.h"
|
||||
#include "CutsceneMgr.h"
|
||||
#include "Font.h"
|
||||
#include "Hud.h"
|
||||
#include "Text.h"
|
||||
#include "Timer.h"
|
||||
#include "World.h"
|
||||
@ -24,7 +25,6 @@
|
||||
#include "Weather.h"
|
||||
#include "win.h"
|
||||
|
||||
|
||||
CPad *Pads = (CPad*)0x6F0360; // [2]
|
||||
CMousePointerStateHelper &MousePointerStateHelper = *(CMousePointerStateHelper*)0x95CC8C;
|
||||
|
||||
@ -70,6 +70,28 @@ WRAPPER void StrongGripCheat() { EAXJMP(0x491670); }
|
||||
WRAPPER void NastyLimbsCheat() { EAXJMP(0x4916A0); }
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifdef KANGAROO_CHEAT
|
||||
void KangarooCheat()
|
||||
{
|
||||
wchar *string;
|
||||
CPed *playerPed = FindPlayerPed();
|
||||
int m_fMass;
|
||||
|
||||
if (playerPed->m_ped_flagI80) {
|
||||
string = TheText.Get("CHEATOF");
|
||||
m_fMass = 70.0f;
|
||||
} else {
|
||||
string = TheText.Get("CHEAT1");
|
||||
m_fMass = 15.0f;
|
||||
}
|
||||
CHud::SetHelpMessage(string, 1);
|
||||
playerPed->m_ped_flagI80 = !playerPed->m_ped_flagI80;
|
||||
|
||||
playerPed->m_fMass = m_fMass;
|
||||
playerPed->m_fAirResistance = 0.4f / m_fMass;
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
CControllerState::Clear(void)
|
||||
{
|
||||
@ -509,6 +531,12 @@ void CPad::AddToPCCheatString(char c)
|
||||
// "NASTYLIMBSCHEAT"
|
||||
if ( !_CHEATCMP("TAEHCSBMILYTSAN") )
|
||||
NastyLimbsCheat();
|
||||
|
||||
#ifdef KANGAROO_CHEAT
|
||||
// "KANGAROO"
|
||||
if (!_CHEATCMP("OORAGNAK"))
|
||||
KangarooCheat();
|
||||
#endif
|
||||
|
||||
#undef _CHEATCMP
|
||||
}
|
||||
|
@ -78,4 +78,4 @@ enum Config {
|
||||
//#define USE_MY_DOCUMENTS
|
||||
#define NASTY_GAME
|
||||
#define PS2_MATFX
|
||||
|
||||
#define KANGAROO_CHEAT
|
||||
|
@ -435,6 +435,9 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
||||
m_ped_flagI4 = false;
|
||||
bRecordedForReplay = false;
|
||||
m_ped_flagI10 = false;
|
||||
#ifdef KANGAROO_CHEAT
|
||||
m_ped_flagI80 = false;
|
||||
#endif
|
||||
|
||||
if ((CGeneral::GetRandomNumber() & 3) == 0)
|
||||
m_ped_flagD1 = true;
|
||||
@ -461,12 +464,12 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
||||
|
||||
for(int i = 0; i < NUM_PED_WEAPONTYPES; i++)
|
||||
{
|
||||
CWeapon *weapon = GetWeapon(i);
|
||||
weapon->m_eWeaponType = WEAPONTYPE_UNARMED;
|
||||
weapon->m_eWeaponState = WEAPONSTATE_READY;
|
||||
weapon->m_nAmmoInClip = 0;
|
||||
weapon->m_nAmmoTotal = 0;
|
||||
weapon->m_nTimer = 0;
|
||||
CWeapon &weapon = GetWeapon(i);
|
||||
weapon.m_eWeaponType = WEAPONTYPE_UNARMED;
|
||||
weapon.m_eWeaponState = WEAPONSTATE_READY;
|
||||
weapon.m_nAmmoInClip = 0;
|
||||
weapon.m_nAmmoTotal = 0;
|
||||
weapon.m_nTimer = 0;
|
||||
}
|
||||
|
||||
m_lastHitState = 0;
|
||||
@ -479,23 +482,27 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
|
||||
CPopulation::UpdatePedCount(m_nPedType, false);
|
||||
}
|
||||
|
||||
void
|
||||
uint32
|
||||
CPed::GiveWeapon(eWeaponType weaponType, uint32 ammo)
|
||||
{
|
||||
if (HasWeapon(weaponType)) {
|
||||
if (ammo > 99999)
|
||||
m_weapons[weaponType].m_nAmmoTotal = 99999;
|
||||
else
|
||||
m_weapons[weaponType].m_nAmmoTotal = ammo;
|
||||
CWeapon &weapon = GetWeapon(weaponType);
|
||||
|
||||
m_weapons[weaponType].Reload();
|
||||
if (HasWeapon(weaponType)) {
|
||||
if (weapon.m_nAmmoTotal + ammo > 99999)
|
||||
weapon.m_nAmmoTotal = 99999;
|
||||
else
|
||||
weapon.m_nAmmoTotal += ammo;
|
||||
|
||||
weapon.Reload();
|
||||
} else {
|
||||
m_weapons[weaponType].Initialise(weaponType, ammo);
|
||||
weapon.Initialise(weaponType, ammo);
|
||||
// TODO: It seems game uses this as both weapon count and max WeaponType we have, which is ofcourse erroneous.
|
||||
m_maxWeaponTypeAllowed++;
|
||||
}
|
||||
if (m_weapons[weaponType].m_eWeaponState == WEAPONSTATE_OUT_OF_AMMO)
|
||||
m_weapons[weaponType].m_eWeaponState = WEAPONSTATE_READY;
|
||||
if (weapon.m_eWeaponState == WEAPONSTATE_OUT_OF_AMMO)
|
||||
weapon.m_eWeaponState = WEAPONSTATE_READY;
|
||||
|
||||
return weaponType;
|
||||
}
|
||||
|
||||
static RwObject*
|
||||
@ -1227,8 +1234,8 @@ bool
|
||||
CPed::SelectGunIfArmed(void)
|
||||
{
|
||||
for (int i = 0; i < m_maxWeaponTypeAllowed; i++) {
|
||||
if (GetWeapon(i)->m_nAmmoTotal > 0) {
|
||||
eWeaponType weaponType = GetWeapon(i)->m_eWeaponType;
|
||||
if (GetWeapon(i).m_nAmmoTotal > 0) {
|
||||
eWeaponType weaponType = GetWeapon(i).m_eWeaponType;
|
||||
if (weaponType >= WEAPONTYPE_COLT45 && weaponType != WEAPONTYPE_M16 && weaponType <= WEAPONTYPE_FLAMETHROWER) {
|
||||
SetCurrentWeapon(i);
|
||||
return true;
|
||||
|
@ -382,7 +382,7 @@ public:
|
||||
bool IsPointerValid(void);
|
||||
void SortPeds(CPed**, int, int);
|
||||
void BuildPedLists(void);
|
||||
void GiveWeapon(eWeaponType weaponType, uint32 ammo);
|
||||
uint32 GiveWeapon(eWeaponType weaponType, uint32 ammo);
|
||||
void SetPedStats(ePedStats);
|
||||
static void GetLocalPositionToOpenCarDoor(CVector *output, CVehicle *veh, uint32 enterType, float offset);
|
||||
static void GetPositionToOpenCarDoor(CVector *output, CVehicle *veh, uint32 enterType, float seatPosMult);
|
||||
@ -416,8 +416,8 @@ public:
|
||||
static void PedSetQuickDraggedOutCarPositionCB(CAnimBlendAssociation *assoc, void *arg);
|
||||
static void PedSetDraggedOutCarPositionCB(CAnimBlendAssociation *assoc, void *arg);
|
||||
|
||||
inline bool HasWeapon(uint32 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
|
||||
inline CWeapon *GetWeapon(uint32 weaponType) { return &m_weapons[weaponType]; }
|
||||
inline bool HasWeapon(uint8 weaponType) { return m_weapons[weaponType].m_eWeaponType == weaponType; }
|
||||
inline CWeapon &GetWeapon(uint8 weaponType) { return m_weapons[weaponType]; }
|
||||
inline CWeapon *GetWeapon(void) { return &m_weapons[m_currentWeapon]; }
|
||||
inline RwFrame *GetNodeFrame(int nodeId) { return m_pFrames[nodeId]->frame; }
|
||||
|
||||
|
@ -27,11 +27,11 @@ CPedIK::GetComponentPosition(RwV3d *pos, PedNode node)
|
||||
RwMatrix *mat;
|
||||
|
||||
f = m_ped->GetNodeFrame(node);
|
||||
mat = &f->modelling;
|
||||
mat = RwFrameGetMatrix(f);
|
||||
*pos = mat->pos;
|
||||
|
||||
for (f = RwFrameGetParent(f); f; f = RwFrameGetParent(f))
|
||||
RwV3dTransformPoints(pos, pos, 1, &f->modelling);
|
||||
RwV3dTransformPoints(pos, pos, 1, RwFrameGetMatrix(f));
|
||||
}
|
||||
|
||||
RwMatrix*
|
||||
@ -39,10 +39,10 @@ CPedIK::GetWorldMatrix(RwFrame *source, RwMatrix *destination)
|
||||
{
|
||||
RwFrame *i;
|
||||
|
||||
*destination = source->modelling;
|
||||
*destination = *RwFrameGetMatrix(source);
|
||||
|
||||
for (i = RwFrameGetParent(source); i; i = RwFrameGetParent(i))
|
||||
RwMatrixTransform(destination, &i->modelling, rwCOMBINEPOSTCONCAT);
|
||||
RwMatrixTransform(destination, RwFrameGetMatrix(i), rwCOMBINEPOSTCONCAT);
|
||||
|
||||
return destination;
|
||||
}
|
||||
|
@ -300,10 +300,10 @@ void CHud::Draw()
|
||||
/*
|
||||
DrawAmmo
|
||||
*/
|
||||
int16 AmmoAmount = CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition;
|
||||
int32 AmmoInClip = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoInClip;
|
||||
int32 TotalAmmo = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal;
|
||||
int32 Ammo, Clip;
|
||||
uint32 AmmoAmount = CWeaponInfo::GetWeaponInfo(FindPlayerPed()->GetWeapon()->m_eWeaponType)->m_nAmountofAmmunition;
|
||||
uint32 AmmoInClip = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoInClip;
|
||||
uint32 TotalAmmo = CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_weapons[CWorld::Players[CWorld::PlayerInFocus].m_pPed->m_currentWeapon].m_nAmmoTotal;
|
||||
uint32 Ammo, Clip;
|
||||
|
||||
if (AmmoAmount <= 1 || AmmoAmount >= 1000)
|
||||
sprintf(sTemp, "%d", TotalAmmo);
|
||||
@ -1359,7 +1359,7 @@ void CHud::SetHelpMessage(wchar *message, bool quick)
|
||||
CMessages::InsertPlayerControlKeysInString(m_HelpMessage);
|
||||
|
||||
for (int i = 0; i < 256; i++) {
|
||||
m_LastHelpMessage[i] = message[i];
|
||||
m_LastHelpMessage[i] = 0;
|
||||
}
|
||||
|
||||
m_HelpMessageState = 0;
|
||||
@ -1443,7 +1443,7 @@ STARTPATCHES
|
||||
InjectHook(0x5048F0, &CHud::Initialise, PATCH_JUMP);
|
||||
InjectHook(0x504CC0, &CHud::ReInitialise, PATCH_JUMP);
|
||||
InjectHook(0x50A250, &CHud::SetBigMessage, PATCH_JUMP);
|
||||
//InjectHook(0x5051E0, &CHud::SetHelpMessage, PATCH_JUMP);
|
||||
InjectHook(0x5051E0, &CHud::SetHelpMessage, PATCH_JUMP);
|
||||
InjectHook(0x50A210, &CHud::SetMessage, PATCH_JUMP);
|
||||
InjectHook(0x50A320, &CHud::SetPagerMessage, PATCH_JUMP);
|
||||
InjectHook(0x505290, &CHud::SetVehicleName, PATCH_JUMP);
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
eWeaponState m_eWeaponState;
|
||||
uint32 m_nAmmoInClip;
|
||||
uint32 m_nAmmoTotal;
|
||||
int32 m_nTimer;
|
||||
uint32 m_nTimer;
|
||||
bool m_bAddRotOffset;
|
||||
|
||||
CWeapon() {
|
||||
|
@ -61,7 +61,7 @@ CWeaponInfo::LoadWeaponData(void)
|
||||
char animToPlay[32], anim2ToPlay[32];
|
||||
|
||||
CAnimBlendAssociation *animAssoc;
|
||||
AnimationId animId, anim2Id;
|
||||
AnimationId animId;
|
||||
|
||||
int bp, buflen;
|
||||
int lp, linelen;
|
||||
@ -101,7 +101,6 @@ CWeaponInfo::LoadWeaponData(void)
|
||||
fireOffsetY = 0.0f;
|
||||
fireOffsetZ = 0.0f;
|
||||
animId = ANIM_WALK;
|
||||
anim2Id = ANIM_WALK;
|
||||
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",
|
||||
@ -136,9 +135,9 @@ CWeaponInfo::LoadWeaponData(void)
|
||||
animAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, animToPlay);
|
||||
animId = static_cast<AnimationId>(animAssoc->animId);
|
||||
|
||||
if (strncmp(anim2ToPlay, "null", 5) != 0) {
|
||||
if (strncmp(anim2ToPlay, "null", 4) != 0) {
|
||||
animAssoc = CAnimManager::GetAnimAssociation(ASSOCGRP_STD, anim2ToPlay);
|
||||
anim2Id = static_cast<AnimationId>(animAssoc->animId);
|
||||
ms_apWeaponInfos[weaponType].m_Anim2ToPlay = static_cast<AnimationId>(animAssoc->animId);
|
||||
}
|
||||
|
||||
CVector vecFireOffset(fireOffsetX, fireOffsetY, fireOffsetZ);
|
||||
@ -155,7 +154,6 @@ CWeaponInfo::LoadWeaponData(void)
|
||||
ms_apWeaponInfos[weaponType].m_fSpread = spread;
|
||||
ms_apWeaponInfos[weaponType].m_vecFireOffset = vecFireOffset;
|
||||
ms_apWeaponInfos[weaponType].m_AnimToPlay = animId;
|
||||
ms_apWeaponInfos[weaponType].m_Anim2ToPlay = anim2Id;
|
||||
ms_apWeaponInfos[weaponType].m_fAnimLoopStart = animLoopStart * 0.03f;
|
||||
ms_apWeaponInfos[weaponType].m_fAnimLoopEnd = animLoopEnd * 0.03f;
|
||||
ms_apWeaponInfos[weaponType].m_fAnimFrameFire = delayBetweenAnimAndFire * 0.03f;
|
||||
|
Loading…
Reference in New Issue
Block a user