mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-04 02:41:19 +00:00
15e8f0b53c
Recast functions have preconditions for arguments they don't validate. This may produce garbage data which may lead to crash. Check arguments and log when they are invalid. Do not throw exceptions when these function calls fail, capture Recast reported errors via RecastContext inherited from rcContext and log them.
29 lines
610 B
C++
29 lines
610 B
C++
#ifndef OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTCONTEXT_H
|
|
#define OPENMW_COMPONENTS_DETOURNAVIGATOR_RECASTCONTEXT_H
|
|
|
|
#include "tileposition.hpp"
|
|
|
|
#include <string>
|
|
|
|
#include <Recast.h>
|
|
|
|
namespace DetourNavigator
|
|
{
|
|
struct AgentBounds;
|
|
|
|
class RecastContext final : public rcContext
|
|
{
|
|
public:
|
|
explicit RecastContext(const TilePosition& tilePosition, const AgentBounds& agentBounds);
|
|
|
|
const std::string& getPrefix() const { return mPrefix; }
|
|
|
|
private:
|
|
std::string mPrefix;
|
|
|
|
void doLog(rcLogCategory category, const char* msg, int len) override;
|
|
};
|
|
}
|
|
|
|
#endif
|