Update to new path schema + add NPCPath struct

This commit is contained in:
gsemaj
2021-05-03 15:29:33 -04:00
committed by Gent Semaj
parent 5f29ea93d8
commit d5e65fda3c
4 changed files with 81 additions and 14 deletions

View File

@@ -8,6 +8,8 @@ const int SLIDER_SPEED = 1200;
const int SLIDER_STOP_TICKS = 16;
const int SLIDER_GAP_SIZE = 45000;
const int NPC_DEFAULT_SPEED = 300;
struct Vec3 {
int x, y, z;
};
@@ -24,9 +26,19 @@ struct TransportLocation {
int npcID, x, y, z;
};
struct NPCPath {
std::vector<Vec3> points;
std::vector<int32_t> targetIDs;
std::vector<int32_t> targetTypes;
int speed;
int escortTaskID;
bool isRelative;
};
namespace Transport {
extern std::map<int32_t, TransportRoute> Routes;
extern std::map<int32_t, TransportLocation> Locations;
extern std::vector<NPCPath> NPCPaths; // predefined NPC paths
extern std::map<int32_t, std::queue<Vec3>> SkywayPaths; // predefined skyway paths with points
extern std::unordered_map<CNSocket*, std::queue<Vec3>> SkywayQueues; // player sockets with queued broomstick points
extern std::unordered_map<int32_t, std::queue<Vec3>> NPCQueues; // NPC ids with queued pathing points