Skip to content

Commit

Permalink
Version 0.816
Browse files Browse the repository at this point in the history
- Add fn_crouchToggle to replace cl_crouchToggle (which is server controlled)
- Expanded range for fn_fov (45-100)
- Clean up commented code

Signed-off-by: jedi95 <[email protected]>
  • Loading branch information
jedi95 committed Aug 17, 2023
1 parent bd7b4e0 commit 2e350ac
Show file tree
Hide file tree
Showing 30 changed files with 36 additions and 256 deletions.
6 changes: 0 additions & 6 deletions Mods/Falcon/Code/Actor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,6 @@ CActor::CActor()
, m_reviveNoReactionTime(0.f)
{
m_currentPhysProfile=GetDefaultProfile(eEA_Physics);
//memset(&m_stances,0,sizeof(m_stances));
//SetupStance(STANCE_NULL,&SStanceInfo());

m_timeImpulseRecover = 0.0f;
m_airResistance = 0.0f;
m_airControl = 1.0f;
Expand Down Expand Up @@ -891,7 +888,6 @@ void CActor::RagDollize( bool fallAndPlay )
IAnimationGraphState *animGraph = GetAnimationGraphState();
if (animGraph)
animGraph->PushForcedState( "FallAndPlay" );
//animGraph->SetInput("Signal", "fall");
}

// [Mikko] 12.10.2007 Skipping the timer reset here or else QL tranquilized characters does not work.
Expand Down Expand Up @@ -1459,10 +1455,8 @@ void CActor::Update(SEntityUpdateContext& ctx, int slot)
// NOTE Sep 13, 2007: <pvl> UpdateGrab() moved into an animation system callback -
// due to complexities in update ordering previous frame's bone positions
// were still used by the GrabHandler when updated from here.
//UpdateGrab(ctx.fFrameTime);
UpdateAnimGraph( m_pAnimatedCharacter?m_pAnimatedCharacter->GetAnimationGraphState():NULL );

//
// get stats table
if (!m_actorStats)
{
Expand Down
15 changes: 1 addition & 14 deletions Mods/Falcon/Code/Expansion/Weapons/GrenadeLaunch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class CGrenadeLaunch::ScheduleReload
CWeapon *_pWeapon;
};

bool CGrenadeLaunch::Shoot(bool resetAnimation, bool autoreload/* =true */, bool noSound /* =false */)
bool CGrenadeLaunch::Shoot(bool resetAnimation, bool autoreload, bool noSound)
{
IEntityClass* spawn_ammo = m_grenadeLaunchParams.ammo_type_class;

Expand All @@ -141,13 +141,9 @@ bool CGrenadeLaunch::Shoot(bool resetAnimation, bool autoreload/* =true */, bool
}

bool res = InternalShoot(spawn_ammo, resetAnimation, autoreload, noSound);
//bool res = CSingle::Shoot(resetAnimation, autoreload, noSound);

if (m_grenadeLaunchParams.remote_detonated && m_projectileId && m_projectileId != m_lastGrenadeId)
{
/*if (m_launchedGrenades.size() >= m_fireparams.clip_size)
StartSecondaryFire(0);*/

m_launchedGrenades.push_back(m_projectileId);
m_lastGrenadeId=m_projectileId;
}
Expand All @@ -166,13 +162,9 @@ void CGrenadeLaunch::NetShootEx(const Vec3 &pos, const Vec3 &dir, const Vec3 &ve
IEntityClass* spawn_ammo = m_grenadeLaunchParams.ammo_type_class;

InternalNetShootEx(spawn_ammo, pos, dir, vel, hit, extra, ph);
//CSingle::NetShootEx(pos, dir, vel, hit, extra, ph);

if (m_grenadeLaunchParams.remote_detonated && m_projectileId && m_projectileId != m_lastGrenadeId)
{
/*if (m_launchedGrenades.size() >= m_fireparams.clip_size)
StartSecondaryFire(0);*/

m_launchedGrenades.push_back(m_projectileId);
m_lastGrenadeId=m_projectileId;
}
Expand All @@ -191,8 +183,6 @@ void CGrenadeLaunch::NetStartSecondaryFire()
for(TLaunchedGrenades::const_iterator it=m_launchedGrenades.begin(); it != m_launchedGrenades.end(); ++it)
{
IEntity *pGrenade=gEnv->pEntitySystem->GetEntity(*it);
//IGameObject *pBomb=gEnv->pGame->GetIGameFramework()->GetGameObject(*it);

if (pGrenade)
{
// Trigger grenade explosion
Expand Down Expand Up @@ -320,8 +310,6 @@ void CGrenadeLaunch::Update(float frameTime, uint frameId)
QuatT tr=pMagazine->GetAttRelativeDefault();
Quat rot;

//gEnv->pLog->Log(">>> Rotate ratio: %f", ratio);

rot=Quat::CreateSlerp(tr.q, m_magazineRotation, min(ratio, 1.0f));
tr.q=rot;
pMagazine->SetAttRelativeDefault(tr);
Expand Down Expand Up @@ -355,7 +343,6 @@ void CGrenadeLaunch::ResetShells()
if (pCharacter)
{
IAttachmentManager* pAttachMan = pCharacter->GetIAttachmentManager();
// gEnv->pLog->Log(">>> Resetting shells at shot count: %d", shot_count);

if (m_magazineDrum >= 0)
{
Expand Down
2 changes: 1 addition & 1 deletion Mods/Falcon/Code/FalconVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#include "gitparams.h"

#define _Falcon_Version_Major 0
#define _Falcon_Version_Minor 815
#define _Falcon_Version_Minor 816

#define _Falcon_Commit STR(GIT_CUR_COMMIT)
#define _Falcon_ISA "SSE2"
Expand Down
14 changes: 8 additions & 6 deletions Mods/Falcon/Code/GameCVars.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ static void BroadcastChangeSafeMode( ICVar * )
void OnFOVUpdated(ICVar* cvar)
{
float newValue = cvar->GetFVal();
if (newValue > 75.0f) {
CryLogAlways("Maximum FOV is 75");
cvar->Set(75);
if (newValue > 100.0f) {
CryLogAlways("Maximum FOV is 100");
cvar->Set(100);
}
else if (newValue < 50.0f) {
CryLogAlways("Maximum FOV is 50");
cvar->Set(50);
else if (newValue < 45.0f) {
CryLogAlways("Maximum FOV is 45");
cvar->Set(45);
}
}

Expand Down Expand Up @@ -147,6 +147,7 @@ void SCVars::InitCVars(IConsole *pConsole)

// Falcon client options
pConsole->Register("fn_constantMouseSensitivity", &fn_constantMouseSensitivity, 0, VF_RESTRICTEDMODE | VF_NOT_NET_SYNCED, "0 = Sensitivity depends on set mass multiplier. 1 = Sensitivity ignores mass. 2 = Sensitivity follows default mass");
pConsole->Register("fn_crouchToggle", &fn_crouchToggle, 0, VF_RESTRICTEDMODE | VF_NOT_NET_SYNCED, "Makes the crouch key work as a toggle");
pConsole->Register("fn_disableShootZoom", &fn_disableShootZoom, 0, VF_RESTRICTEDMODE | VF_NOT_NET_SYNCED, "Disables the zoom in effect when shooting");
pConsole->Register("fn_enableFPBody", &fn_enableFpBody, 0, VF_NOT_NET_SYNCED | VF_RESTRICTEDMODE, "Enable first person body on custom characters");
pConsole->Register("fn_fixExplosivePlant", &fn_fixExplosivePlant, 1, VF_NOT_NET_SYNCED | VF_RESTRICTEDMODE, "Fix planting mines and claymores with high FPS");
Expand Down Expand Up @@ -595,6 +596,7 @@ void SCVars::ReleaseCVars()

// Falcon client options
pConsole->UnregisterVariable("fn_constantMouseSensitivity", true);
pConsole->UnregisterVariable("fn_crouchToggle", true);
pConsole->UnregisterVariable("fn_disableShootZoom", true);
pConsole->UnregisterVariable("fn_enableFPBody", true);
pConsole->UnregisterVariable("fn_fixExplosivePlant", true);
Expand Down
1 change: 1 addition & 0 deletions Mods/Falcon/Code/GameCVars.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ struct SCVars

// Falcon client options
int fn_constantMouseSensitivity;
int fn_crouchToggle;
int fn_disableShootZoom;
int fn_enableFpBody;
int fn_fixExplosivePlant;
Expand Down
2 changes: 1 addition & 1 deletion Mods/Falcon/Code/GameFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
#include "Hunter.h"
#include "Trooper.h"
#include "Shark.h"
//

#include "Item.h"
#include "Weapon.h"
#include "VehicleWeapon.h"
Expand Down
17 changes: 8 additions & 9 deletions Mods/Falcon/Code/GameRules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1079,16 +1079,16 @@ string CGameRules::VerifyName(const char *name, IEntity *pEntity)
{
string nameFormatter(name);

// size limit is 26
if (nameFormatter.size()>26)
nameFormatter.resize(26);

// no spaces at start/end
nameFormatter.TrimLeft(' ');
nameFormatter.TrimRight(' ');

// size limit is 26
if (nameFormatter.size()>26)
nameFormatter.resize(26);

// no $ at the beginning (Patch3: colors are forbidden)
nameFormatter.TrimLeft('$');
nameFormatter.replace("$", "_");

// no empty names
if (nameFormatter.empty())
Expand All @@ -1103,16 +1103,15 @@ string CGameRules::VerifyName(const char *name, IEntity *pEntity)
// search for duplicates
if (IsNameTaken(nameFormatter.c_str(), pEntity))
{
int n=1;
int n = 1;
string appendix;
do
do
{
appendix.Format("(%d)", n++);
} while(IsNameTaken(nameFormatter+appendix));
} while (IsNameTaken(nameFormatter + appendix));

nameFormatter.append(appendix);
}

return nameFormatter;
}

Expand Down
7 changes: 0 additions & 7 deletions Mods/Falcon/Code/GameRulesClientServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,6 @@ void CGameRules::CullEntitiesInExplosion(const ExplosionInfo &explosionInfo)
//------------------------------------------------------------------------
void CGameRules::ClientExplosion(const ExplosionInfo &explosionInfo)
{
// let 3D engine know about explosion (will create holes and remove vegetation)
//if (explosionInfo.hole_size > 0.0f)
//{
//gEnv->p3DEngine->OnExplosion(explosionInfo.pos, explosionInfo.hole_size, true);
//}

TExplosionAffectedEntities affectedEntities;

if (gEnv->bServer)
Expand Down Expand Up @@ -988,7 +982,6 @@ IMPLEMENT_RMI(CGameRules, ClTaggedEntity)
if (!params.entityId)
return true;

//SAFE_HUD_FUNC(GetRadar()->AddTaggedEntity(params.entityId)); //we have no tagging anymore, just temp and non-temp adding
SAFE_HUD_FUNC(GetRadar()->AddEntityToRadar(params.entityId));

SEntityEvent scriptEvent( ENTITY_EVENT_SCRIPT_EVENT );
Expand Down
2 changes: 1 addition & 1 deletion Mods/Falcon/Code/GrabHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ bool CAnimatedGrabHandler::SetGrab(SmartScriptTable &rParams)
return true;
}

bool CAnimatedGrabHandler::StartGrab(/*EntityId objectId*/)
bool CAnimatedGrabHandler::StartGrab()
{
if (m_grabStats.grabAnimGraphSignal)
{
Expand Down
33 changes: 0 additions & 33 deletions Mods/Falcon/Code/GunTurret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,6 @@ void CGunTurret::ReadProperties(IScriptTable *pProperties)
//------------------------------------------------------------------------
bool CGunTurret::ReadItemParams(const IItemParamsNode *root)
{
//m_tpgeometry.position.Set(0.f, 0.f, 0.f);
//m_aux0geometry.position.Set(0.f, 0.f, 0.f);

if (!CWeapon::ReadItemParams(root))
return false;

Expand All @@ -330,16 +327,7 @@ bool CGunTurret::ReadItemParams(const IItemParamsNode *root)
reader.Read("barrel_helper", m_barrelHelper);
reader.Read("fire_helper", m_fireHelper);
reader.Read("rocket_helper", m_rocketHelper);
/*Matrix34 tm = GetEntity()->GetSlotLocalTM(eIGS_Aux0,false);
tm.SetTranslation(GetSlotHelperPos(eIGS_Aux0,m_radarHelper.c_str(),false));
GetEntity()->SetSlotLocalTM(eIGS_ThirdPerson,tm);

if (GetEntity()->IsSlotValid(eIGS_Aux1))
{
tm.SetTranslation(GetSlotHelperPos(eIGS_ThirdPerson,m_barrelHelper.c_str(),false));
GetEntity()->SetSlotLocalTM(eIGS_Aux1,tm);
}*/
m_radarHelperPos = GetSlotHelperPos(eIGS_Aux0, m_radarHelper.c_str(), false);
m_barrelHelperPos = GetSlotHelperPos(eIGS_ThirdPerson, m_barrelHelper.c_str(), false);
m_fireHelperPos = GetSlotHelperPos(eIGS_ThirdPerson, m_fireHelper.c_str(), false);
Expand Down Expand Up @@ -514,7 +502,6 @@ Vec3 CGunTurret::GetFiringPos(const Vec3 &probableHit) const
//------------------------------------------------------------------------
Vec3 CGunTurret::GetWeaponPos() const
{
//return GetEntity()->GetWorldPos();
return GetEntity()->GetSlotWorldTM(eIGS_ThirdPerson).GetTranslation();
}

Expand Down Expand Up @@ -542,24 +529,6 @@ bool CGunTurret::IsTargetHostile(IActor *pTarget) const
bool sameTeam = (m_turretparams.team == 0) || (team == 0) || (m_turretparams.team == team);

return !sameSpecies || !sameTeam;

/* IVehicle *pVehicle=g_pGame->GetIGameFramework()->GetIVehicleSystem()->GetVehicle(pTarget->GetId());
if (pVehicle)
{
int seatCount=pVehicle->GetSeatCount();
for (int i=0; i<seatCount; i++)
{
IVehicleSeat *pVehicleSeat=pVehicle->GetSeatById(i);
if (pVehicleSeat && pVehicleSeat->GetPassenger())
{
IEntity *pPassenger=gEnv->pEntitySystem->GetEntity(pVehicleSeat->GetPassenger());
if (pPassenger && IsTargetHostile(pPassenger))
return true;
}
}
}
return false;
*/
}

//------------------------------------------------------------------------
Expand Down Expand Up @@ -1141,15 +1110,13 @@ void CGunTurret::UpdateOrientation(float deltaTime)
{
weaponTM.SetRotationXYZ(weaponAngles);
Vec3 w_trans = turretTM.TransformPoint(m_radarHelperPos);
//Vec3 w_trans = GetSlotHelperPos(eIGS_Aux0,m_radarHelper.c_str(),false);
weaponTM.SetTranslation(w_trans);

GetEntity()->SetSlotLocalTM(eIGS_ThirdPerson, weaponTM);

if (GetEntity()->IsSlotValid(eIGS_Aux1))
{
Vec3 b_trans = weaponTM.TransformPoint(m_barrelHelperPos);
//Vec3 b_trans = GetSlotHelperPos(eIGS_ThirdPerson,m_barrelHelper.c_str(),false);
weaponTM.SetTranslation(b_trans);
GetEntity()->SetSlotLocalTM(eIGS_Aux1, weaponTM*m_barrelRotation);
}
Expand Down
33 changes: 1 addition & 32 deletions Mods/Falcon/Code/HUD/HUD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1407,26 +1407,6 @@ void CHUD::OnLoadingStart(ILevelInfo *pLevel)

m_pHUDCrosshair->GetFlashAnim()->Invoke("clearDamageDirection");
m_pHUDCrosshair->GetFlashAnim()->GetFlashPlayer()->Advance(0.1f);
/*m_pHUDScopes->ShowBinoculars(false);

ShowKillAreaWarning(false, 0);
BreakHUD(0);

GetMissionObjectiveSystem().DeactivateObjectives(false); //deactivate old objectives
m_animMessages.Invoke("reset"); //reset update texts

if(m_pHUDVehicleInterface && m_pHUDVehicleInterface->GetHUDType() != CHUDVehicleInterface::EHUD_NONE)
m_pHUDVehicleInterface->OnExitVehicle(NULL);

m_currentGoal.clear();
m_currentMainObjective.clear();

//disable alien fear effect
m_fSetAgressorIcon = 0.0f;
m_animTargetter.SetVisible(false);
m_bThirdPerson = false;

m_uiWeapondID = 0;*/
}

//-----------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -1705,11 +1685,6 @@ void CHUD::HandleFSCommand(const char *szCommand,const char *szArgs)
{
PlaySound(ESound_Malfunction);
}
/* else if(!stricmp(szCommand,"soundstop_malfunction"))
{
note: hud_malfunction has been changed to oneshot instead of looping sound
PlaySound(ESound_Malfunction,false);
}*/
else if(!stricmp(szCommand,"vehicle_init"))
{
PlaySound(ESound_VehicleIn);
Expand All @@ -1724,11 +1699,9 @@ void CHUD::HandleFSCommand(const char *szCommand,const char *szArgs)
}
else if(!stricmp(szCommand,"hud_download_loop"))
{
//PlaySound(ESound_DownloadLoop);
}
else if(!stricmp(szCommand,"hud_download_stop"))
{
//PlaySound(ESound_DownloadLoop,false);
PlaySound(ESound_DownloadStop);
}
else if(!stricmp(szCommand, "closeBinoculars"))
Expand Down Expand Up @@ -2247,8 +2220,6 @@ bool CHUD::OnAction(const ActionId& action, int activationMode, float value)
CPlayer *pPlayer = static_cast<CPlayer *>(pActor);
if (pPlayer && pPlayer->GetNanoSuit() && !pPlayer->GetNanoSuit()->IsActive())
return false;
/* if(!m_animQuickMenu.IsLoaded())
m_animQuickMenu.Reload();*/
m_animQuickMenu.Invoke("showQuickMenu");
m_animQuickMenu.SetVariable("_alpha",100);

Expand Down Expand Up @@ -2829,7 +2800,6 @@ bool CHUD::ShowPDA(bool show, bool buyMenu)
}
else
{
//m_animBuyZoneIcon.SetVisible(m_pHUDPowerStruggle->m_bInBuyZone&&m_pModalHUD!=&m_animBuyMenu);
m_buyMenuKeyLog.m_state = SBuyMenuKeyLog::eBMKL_Tab;
}

Expand Down Expand Up @@ -3486,7 +3456,7 @@ void CHUD::OnPostUpdate(float frameTime)
}

CGameRules *pGameRules=g_pGame->GetGameRules();
if(gEnv->bMultiplayer && pPlayer->GetSpectatorMode() /*|| (pGameRules && pGameRules->GetTeamCount() > 1 && pGameRules->GetTeam(pPlayer->GetEntityId()) == 0))*/) //SPECTATOR Mode
if(gEnv->bMultiplayer && pPlayer->GetSpectatorMode()) //SPECTATOR Mode
{
if(!m_animSpectate.IsLoaded())
{
Expand Down Expand Up @@ -4122,7 +4092,6 @@ bool CHUD::UpdateTimers(float frameTime)
// FIXME: this should be moved to ::EnergyChanged
if(m_fSuitEnergy > (NANOSUIT_ENERGY*0.25f) && m_pNanoSuit->GetSuitEnergy() < (NANOSUIT_ENERGY*0.25f))
{
//DisplayFlashMessage("@energy_critical", 3, ColorF(1.0,0,0));
if(now.GetMilliSeconds() - m_fLastSoundPlayedCritical > 30000)
{
m_fLastSoundPlayedCritical = now.GetMilliSeconds();
Expand Down
Loading

0 comments on commit 2e350ac

Please sign in to comment.