Skip to content

Commit

Permalink
Merge pull request #1016 from Archangel35757/ROFF2_bug_fixes
Browse files Browse the repository at this point in the history
Improve code readability... use VectorClear to zero-out vec3_t variables
  • Loading branch information
xycaleth authored May 19, 2019
2 parents e350123 + ade0e98 commit a2ea6ad
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions code/game/g_roff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,16 +324,17 @@ static void G_RoffNotetrackCallback( gentity_t *ent, const char *notetrack)
{
if (strcmp(addlArg, "absolute") == 0)
{
VectorSubtract(ent->pos1, ent->pos1, ent->pos1);
VectorSubtract(ent->pos2, ent->pos2, ent->pos2);
VectorClear(ent->pos1);
VectorClear(ent->pos2);

VectorSubtract(ent->s.pos.trBase, ent->s.pos.trBase, ent->s.pos.trBase);
VectorSubtract(ent->currentOrigin, ent->currentOrigin, ent->currentOrigin);
VectorSubtract(ent->s.apos.trBase, ent->s.apos.trBase, ent->s.apos.trBase);
VectorSubtract(ent->currentAngles, ent->currentAngles, ent->currentAngles);
VectorClear(ent->currentOrigin);
VectorClear(ent->currentAngles);

VectorCopy(ent->currentOrigin, ent->s.origin2);
VectorCopy(ent->currentAngles, ent->s.angles2);
VectorClear(ent->s.pos.trBase);
VectorClear(ent->s.apos.trBase);

VectorClear(ent->s.origin2);
VectorClear(ent->s.angles2);
}
else if (strcmp(addlArg, "relative") == 0)
{
Expand Down

0 comments on commit a2ea6ad

Please sign in to comment.