make Predict func accessible outside of prediction.cpp

This commit is contained in:
BenCat07 2019-06-22 14:27:26 +02:00
parent 788cb9725d
commit ae4b83a45f
2 changed files with 5 additions and 3 deletions

View File

@ -9,6 +9,7 @@
#include <enums.hpp>
#include "config.h"
#include "vector"
class CachedEntity;
class Vector;
@ -21,6 +22,7 @@ Vector BuildingPrediction(CachedEntity *building, Vector vec, float speed, float
Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed, float gravitymod, float entgmod);
Vector ProjectilePrediction_Engine(CachedEntity *ent, int hb, float speed, float gravitymod, float entgmod /* ignored */);
std::vector<Vector> Predict(Vector pos, float offset, Vector vel, Vector acceleration, std::pair<Vector, Vector> minmax, float time, int count, bool vischeck = true);
float PlayerGravityMod(CachedEntity *player);
Vector EnginePrediction(CachedEntity *player, float time);

View File

@ -148,7 +148,7 @@ Vector PredictStep(Vector pos, Vector &vel, Vector acceleration, std::pair<Vecto
return result;
}
std::vector<Vector> Predict(Vector pos, float offset, Vector vel, Vector acceleration, std::pair<Vector, Vector> minmax, float time, int count, bool vischeck = true)
std::vector<Vector> Predict(Vector pos, float offset, Vector vel, Vector acceleration, std::pair<Vector, Vector> minmax, float time, int count, bool vischeck)
{
std::vector<Vector> positions;
positions.reserve(count);
@ -169,7 +169,7 @@ std::vector<Vector> Predict(Vector pos, float offset, Vector vel, Vector acceler
prediction = PredictStep(prediction, vel, acceleration, minmax, time);
else
prediction = PredictStep(prediction, vel, acceleration, minmax, time, g_GlobalVars->interval_per_tick, false, dist);
positions.push_back({prediction.x, prediction.y, prediction.z + offset});
positions.push_back({ prediction.x, prediction.y, prediction.z + offset });
}
else
{
@ -477,7 +477,7 @@ Vector ProjectilePrediction(CachedEntity *ent, int hb, float speed, float gravit
float dist_to_ground = DistanceToGround(origin, minmax.first, minmax.second);
Vector acceleration = { 0, 0, -(sv_gravity->GetFloat()) };
Vector last = origin;
Vector last = origin;
for (int steps = 0; steps < maxsteps; steps++, currenttime += steplength)
{