Skip to content

Commit

Permalink
fix(64bit): boss can move before round start
Browse files Browse the repository at this point in the history
  • Loading branch information
Nopied committed Jul 2, 2024
1 parent 6788bf2 commit 61d7f42
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 27 deletions.
12 changes: 0 additions & 12 deletions addons/sourcemod/gamedata/potry.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@
"linux" "@_ZN10CTFShotgun13PrimaryAttackEv"
"windows" " "
}
"CTFPlayer::CanPlayerMove"
{
"linux" "@_ZNK9CTFPlayer13CanPlayerMoveEv"
"windows" " "
}
"CTFSword::GetSwingRange"
{
"linux" "@_ZN8CTFSword13GetSwingRangeEv"
Expand Down Expand Up @@ -194,13 +189,6 @@
"return" "void"
"this" "entity"
}
"CTFPlayer::CanPlayerMove"
{
"signature" "CTFPlayer::CanPlayerMove"
"callconv" "thiscall"
"return" "bool"
"this" "entity"
}
"CTFPlayer::CanPickupDroppedWeapon"
{
"signature" "CTFPlayer::CanPickupDroppedWeapon"
Expand Down
14 changes: 0 additions & 14 deletions addons/sourcemod/scripting/ff2_module/dhooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ void DHooks_Init(GameData gamedata)
CreateDynamicDetour(gamedata, "CTFLunchBox::DrainAmmo", DHookCallback_DrainAmmo_Pre);
CreateDynamicDetour(gamedata, "CTFWeaponBaseMelee::OnEntityHit", _, DHookCallback_OnEntityHit_Post);
CreateDynamicDetour(gamedata, "CTFWeaponBaseMelee::Smack", DHookCallback_Smack_Pre, DHookCallback_Smack_Post);
CreateDynamicDetour(gamedata, "CTFPlayer::CanPlayerMove", DHookCallback_CanPlayerMove_Pre);
}

static void CreateDynamicDetour(GameData gamedata, const char[] name, DHookCallback callbackPre = INVALID_FUNCTION, DHookCallback callbackPost = INVALID_FUNCTION)
Expand Down Expand Up @@ -83,16 +82,3 @@ public MRESReturn DHookCallback_Smack_Post(int weapon)

return MRES_Ignored;
}

public MRESReturn DHookCallback_CanPlayerMove_Pre(int client, DHookReturn hReturn)
{
if(CheckRoundState() < FF2RoundState_RoundRunning
&& BossTeam == TF2_GetClientTeam(client))
{
hReturn.Value = false;
return MRES_Supercede;
}


return MRES_Ignored;
}
4 changes: 3 additions & 1 deletion addons/sourcemod/scripting/freak_fortress_2.sp
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,8 @@ public Action OnRoundStart(Event event, const char[] name, bool dontBroadcast)
if(Boss[boss])
{
AssignTeam(Boss[boss], BossTeam);
SetEntityMoveType(Boss[boss], MOVETYPE_NONE);

CreateTimer(0.3, MakeBoss, boss, TIMER_FLAG_NO_MAPCHANGE);
BossInfoTimer[boss][0]=CreateTimer(30.2, BossInfoTimer_Begin, boss, TIMER_FLAG_NO_MAPCHANGE);
}
Expand Down Expand Up @@ -1585,7 +1587,7 @@ public Action StartBossTimer(Handle timer)
&& BossTeam == TF2_GetClientTeam(Boss[boss]))
{
isBossAlive=true;
SetEntityMoveType(Boss[boss], MOVETYPE_NONE);
// SetEntityMoveType(Boss[boss], MOVETYPE_NONE);

BossHealthMax[boss]=ParseFormula(boss, "health", RoundFloat(Pow((560.8+float(RedAlivePlayers))*(float(RedAlivePlayers)-1.0), 1.0341)+2046.0));
BossHealth[boss]=BossHealthLast[boss]=BossHealthMax[boss]*BossLivesMax[boss];
Expand Down

0 comments on commit 61d7f42

Please sign in to comment.