Skip to content

Commit

Permalink
Fix frag plasma (#394)
Browse files Browse the repository at this point in the history
* fixed frag caused by debug2 flag affecting plasma shot direction
* adjust plasma speed by the player's speed
* quash @copydoc warnings
  • Loading branch information
tra authored Mar 26, 2024
1 parent 1b7fddd commit 171de87
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 21 deletions.
6 changes: 3 additions & 3 deletions src/assets/AssetManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -329,15 +329,15 @@ class AssetManager {
template <typename T>
static void ReviewPriorities(AssetCache<T> &cache);

/** @copydoc */
/** @copydoc AssetManager::ReviewPriorities */
template <>
void ReviewPriorities(AssetCache<nlohmann::json> &cache);

/** @copydoc */
/** @copydoc AssetManager::ReviewPriorities */
template <>
void ReviewPriorities(AssetCache<OggFile> &cache);

/** @copydoc */
/** @copydoc AssetManager::ReviewPriorities */
template <>
void ReviewPriorities(AssetCache<HullConfigRecord> &cache);
};
24 changes: 6 additions & 18 deletions src/game/CAbstractPlayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -463,15 +463,9 @@ void CAbstractPlayer::PlaceHUDParts() {
} else {
mt = &viewPortPart->itsTransform;

if (debug2Flag) {
theHit.direction[0] = FMul((*mt)[2][0], PLAYERMISSILESPEED) + speed[0];
theHit.direction[1] = FMul((*mt)[2][1], PLAYERMISSILESPEED) + speed[1];
theHit.direction[2] = FMul((*mt)[2][2], PLAYERMISSILESPEED) + speed[2];
} else {
theHit.direction[0] = FMul((*mt)[2][0], PLAYERMISSILESPEED);
theHit.direction[1] = FMul((*mt)[2][1], PLAYERMISSILESPEED);
theHit.direction[2] = FMul((*mt)[2][2], PLAYERMISSILESPEED);
}
theHit.direction[0] = FMul((*mt)[2][0], PLAYERMISSILESPEED) + speed[0];
theHit.direction[1] = FMul((*mt)[2][1], PLAYERMISSILESPEED) + speed[1];
theHit.direction[2] = FMul((*mt)[2][2], PLAYERMISSILESPEED) + speed[2];

theHit.direction[3] = 0;
NormalizeVector(3, theHit.direction);
Expand Down Expand Up @@ -1696,15 +1690,9 @@ void CAbstractPlayer::GunActions() {
CombineTransforms(&m1, &m2, &viewPortPart->itsTransform);
MTranslate(speed[0], speed[1], speed[2], &m2);

if (debug2Flag) {
theHit.direction[0] = FMul(m2[2][0], PLAYERMISSILESPEED) + speed[0];
theHit.direction[1] = FMul(m2[2][1], PLAYERMISSILESPEED) + speed[1];
theHit.direction[2] = FMul(m2[2][2], PLAYERMISSILESPEED) + speed[2];
} else {
theHit.direction[0] = FMul(m2[2][0], PLAYERMISSILESPEED);
theHit.direction[1] = FMul(m2[2][1], PLAYERMISSILESPEED);
theHit.direction[2] = FMul(m2[2][2], PLAYERMISSILESPEED);
}
theHit.direction[0] = FMul(m2[2][0], PLAYERMISSILESPEED) + speed[0];
theHit.direction[1] = FMul(m2[2][1], PLAYERMISSILESPEED) + speed[1];
theHit.direction[2] = FMul(m2[2][2], PLAYERMISSILESPEED) + speed[2];

missileSpeed[0] = theHit.direction[0];
missileSpeed[1] = theHit.direction[1];
Expand Down

0 comments on commit 171de87

Please sign in to comment.