mirror of
https://github.com/shavitush/bhoptimer.git
synced 2025-12-07 10:28:26 +00:00
Changed arg-less !spec to automatically forward to replay bot. (#574)
This commit is contained in:
parent
59b5664439
commit
03074283ab
@ -1178,19 +1178,29 @@ public Action Command_Spec(int client, int args)
|
|||||||
|
|
||||||
CleanSwitchTeam(client, 1, false);
|
CleanSwitchTeam(client, 1, false);
|
||||||
|
|
||||||
|
int target = -1;
|
||||||
|
|
||||||
if(args > 0)
|
if(args > 0)
|
||||||
{
|
{
|
||||||
char[] sArgs = new char[MAX_TARGET_LENGTH];
|
char[] sArgs = new char[MAX_TARGET_LENGTH];
|
||||||
GetCmdArgString(sArgs, MAX_TARGET_LENGTH);
|
GetCmdArgString(sArgs, MAX_TARGET_LENGTH);
|
||||||
|
|
||||||
int iTarget = FindTarget(client, sArgs, false, false);
|
target = FindTarget(client, sArgs, false, false);
|
||||||
|
|
||||||
if(iTarget == -1)
|
if(target == -1)
|
||||||
{
|
{
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", iTarget);
|
else if(gB_Replay)
|
||||||
|
{
|
||||||
|
target = Shavit_GetReplayBotIndex(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(IsValidClient(target, true))
|
||||||
|
{
|
||||||
|
SetEntPropEnt(client, Prop_Send, "m_hObserverTarget", target);
|
||||||
}
|
}
|
||||||
|
|
||||||
return Plugin_Handled;
|
return Plugin_Handled;
|
||||||
|
|||||||
@ -250,6 +250,11 @@ public int Native_GetReplayBotCurrentFrame(Handle handler, int numParams)
|
|||||||
|
|
||||||
public int Native_GetReplayBotIndex(Handle handler, int numParams)
|
public int Native_GetReplayBotIndex(Handle handler, int numParams)
|
||||||
{
|
{
|
||||||
|
if(gB_CentralBot)
|
||||||
|
{
|
||||||
|
return gA_CentralCache[iCentralClient];
|
||||||
|
}
|
||||||
|
|
||||||
return gI_ReplayBotClient[GetNativeCell(1)];
|
return gI_ReplayBotClient[GetNativeCell(1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user