CPPRP icon indicating copy to clipboard operation
CPPRP copied to clipboard

MSVC Compilation Issue (with fix)

Open davechurchill opened this issue 1 year ago • 0 comments

I learned how to iterate through the actorStats via this line of code: https://github.com/Bakkes/CPPRP/blob/master/CPPRPBM/CPPBM.cpp#L167

replayFile->tickables.push_back([&](const CPPRP::Frame f, const std::unordered_map<int, CPPRP::ActorStateData>& actorStats)

However when I tried to compile this in VS 2022, I got an error. I looked into it, and the typedef for tickable uses decltype(ActorStateData::actorId), which is a uint32_t. When I changed the int key of the map above to uint32_t it worked fine.

fixed line:

replayFile->tickables.push_back([&](const CPPRP::Frame f, const std::unordered_map<uint32_t, CPPRP::ActorStateData>& actorStats)

davechurchill avatar May 25 '23 14:05 davechurchill