Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/rheit/zdoom
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Oelckers committed May 8, 2014
2 parents 1d4ea9f + 2223c12 commit 6988156
Show file tree
Hide file tree
Showing 9 changed files with 248 additions and 200 deletions.
6 changes: 4 additions & 2 deletions src/actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -765,8 +765,8 @@ class AActor : public DThinker
}

// These also set CF_INTERPVIEW for players.
void SetPitch(int p);
void SetAngle(angle_t ang);
void SetPitch(int p, bool interpolate);
void SetAngle(angle_t ang, bool interpolate);

const PClass *GetBloodType(int type = 0) const
{
Expand Down Expand Up @@ -1011,6 +1011,8 @@ class AActor : public DThinker
bool isSlow();
void SetIdle();
void ClearCounters();
FState *GetRaiseState();
void Revive();

FState *FindState (FName label) const
{
Expand Down
6 changes: 6 additions & 0 deletions src/d_net.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1052,6 +1052,12 @@ void NetUpdate (void)
if (singletics)
return; // singletic update is synchronous

if (demoplayback)
{
nettics[0] = (maketic / ticdup);
return; // Don't touch netcmd data while playing a demo, as it'll already exist.
}

// If maketic didn't cross a ticdup boundary, only send packets
// to players waiting for resends.
resendOnly = (maketic / ticdup) == (maketic - i) / ticdup;
Expand Down
106 changes: 72 additions & 34 deletions src/p_acs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4263,6 +4263,18 @@ enum EACSFunctions
ACSF_SetLineActivation,
ACSF_GetLineActivation,
ACSF_GetActorPowerupTics,
ACSF_ChangeActorAngle,
ACSF_ChangeActorPitch, // 80

/* Zandronum's - these must be skipped when we reach 99!
-100:ResetMap(0),
-101 : PlayerIsSpectator(1),
-102 : ConsolePlayerNumber(0),
-103 : GetTeamProperty(2),
-104 : GetPlayerLivesLeft(1),
-105 : SetPlayerLivesLeft(2),
-106 : KickFromGame(2),
*/

// ZDaemon
ACSF_GetTeamScore = 19620, // (int team)
Expand Down Expand Up @@ -4522,6 +4534,50 @@ static bool DoSpawnDecal(AActor *actor, const FDecalTemplate *tpl, int flags, an
angle, distance, !!(flags & SDF_PERMANENT));
}

static void SetActorAngle(AActor *activator, int tid, int angle, bool interpolate)
{
if (tid == 0)
{
if (activator != NULL)
{
activator->SetAngle(angle << 16, interpolate);
}
}
else
{
FActorIterator iterator(tid);
AActor *actor;

while ((actor = iterator.Next()))
{
actor->SetAngle(angle << 16, interpolate);
}
}
}

static void SetActorPitch(AActor *activator, int tid, int angle, bool interpolate)
{
if (tid == 0)
{
if (activator != NULL)
{
activator->SetPitch(angle << 16, interpolate);
}
}
else
{
FActorIterator iterator(tid);
AActor *actor;

while ((actor = iterator.Next()))
{
actor->SetPitch(angle << 16, interpolate);
}
}
}



int DLevelScript::CallFunction(int argCount, int funcIndex, SDWORD *args, const SDWORD *stack, int stackdepth)
{
AActor *actor;
Expand Down Expand Up @@ -5349,6 +5405,20 @@ doplaysound: if (funcIndex == ACSF_PlayActorSound)
}
break;

case ACSF_ChangeActorAngle:
if (argCount >= 2)
{
SetActorAngle(activator, args[0], args[1], argCount > 2 ? !!args[2] : false);
}
break;

case ACSF_ChangeActorPitch:
if (argCount >= 2)
{
SetActorPitch(activator, args[0], args[1], argCount > 2 ? !!args[2] : false);
}
break;

default:
break;
}
Expand Down Expand Up @@ -8323,44 +8393,12 @@ int DLevelScript::RunScript ()
break;

case PCD_SETACTORANGLE: // [GRB]
if (STACK(2) == 0)
{
if (activator != NULL)
{
activator->SetAngle(STACK(1) << 16);
}
}
else
{
FActorIterator iterator (STACK(2));
AActor *actor;

while ( (actor = iterator.Next ()) )
{
actor->SetAngle(STACK(1) << 16);
}
}
SetActorAngle(activator, STACK(2), STACK(1), false);
sp -= 2;
break;

case PCD_SETACTORPITCH:
if (STACK(2) == 0)
{
if (activator != NULL)
{
activator->SetPitch(STACK(1) << 16);
}
}
else
{
FActorIterator iterator (STACK(2));
AActor *actor;

while ( (actor = iterator.Next ()) )
{
actor->SetPitch(STACK(1) << 16);
}
}
SetActorPitch(activator, STACK(2), STACK(1), false);
sp -= 2;
break;

Expand Down
Loading

0 comments on commit 6988156

Please sign in to comment.