Fix style changing breaking timers with teleportptostart disabled (#265)

This commit is contained in:
shavitush 2016-10-04 14:00:23 +03:00
parent 4198548463
commit 904ca69f96
No known key found for this signature in database
GPG Key ID: 0A298F154527B9A4
2 changed files with 3 additions and 15 deletions

View File

@ -615,8 +615,6 @@ public void ChangeClientStyle(int client, BhopStyle style)
Call_StartForward(gH_Forwards_OnRestart);
Call_PushCell(client);
Call_Finish();
StartTimer(client);
}
char[] sStyle = new char[4];
@ -719,12 +717,7 @@ public int Native_GetTimerStatus(Handle handler, int numParams)
public int Native_StartTimer(Handle handler, int numParams)
{
int client = GetNativeCell(1);
if(!IsFakeClient(client))
{
StartTimer(client);
}
StartTimer(GetNativeCell(1));
}
public int Native_StopTimer(Handle handler, int numParams)

View File

@ -2136,6 +2136,8 @@ public void Shavit_OnRestart(int client)
{
if(gB_TeleportToStart && !IsFakeClient(client) && !EmptyZone(gV_MapZones[Zone_Start][0]) && !EmptyZone(gV_MapZones[Zone_Start][1]))
{
Shavit_StartTimer(client);
if(!EmptyZone(gF_CustomSpawn))
{
TeleportEntity(client, gF_CustomSpawn, NULL_VECTOR, view_as<float>({0.0, 0.0, 0.0}));
@ -2145,14 +2147,10 @@ public void Shavit_OnRestart(int client)
{
float vCenter[3];
MakeVectorFromPoints(gV_MapZones[0][0], gV_MapZones[0][1], vCenter);
// calculate center
vCenter[0] /= 2.0;
vCenter[1] /= 2.0;
// i could also use ScaleVector() by 0.5f I guess? dunno which is more resource intensive, so i'll do it manually.
AddVectors(gV_MapZones[0][0], vCenter, vCenter);
vCenter[2] = gV_MapZones[0][0][2];
TeleportEntity(client, vCenter, NULL_VECTOR, view_as<float>({0.0, 0.0, 0.0}));
@ -2166,13 +2164,10 @@ public void Shavit_OnEnd(int client)
{
float vCenter[3];
MakeVectorFromPoints(gV_MapZones[1][0], gV_MapZones[1][1], vCenter);
// calculate center
vCenter[0] /= 2.0;
vCenter[1] /= 2.0;
AddVectors(gV_MapZones[1][0], vCenter, vCenter);
vCenter[2] = gV_MapZones[1][0][2];
TeleportEntity(client, vCenter, NULL_VECTOR, view_as<float>({0.0, 0.0, 0.0}));