remove hardcoded /opt/cathook/data

This commit is contained in:
TotallyNotElite 2019-08-20 22:12:32 +02:00
parent 8122d6d6dc
commit b38ea8b395
2 changed files with 4 additions and 4 deletions

View File

@ -117,10 +117,10 @@ static CatCommand chatcommands_add("chatcommands_add", "chatcommands_add <chat c
chatcomamnd.addcommand(command);
});
static CatCommand chatcommands_file("chatcommands_file", "chatcommands_add <chat command> <filename in /opt/cathook/data/chatcommands>", [](const CCommand &args) {
static CatCommand chatcommands_file("chatcommands_file", "chatcommands_add <chat command> <filename in " DATA_PATH "/chatcommands>", [](const CCommand &args) {
if (args.ArgC() != 3)
{
g_ICvar->ConsoleColorPrintf(MENU_COLOR, "usage: chatcommands_add <chat command> <filename in /opt/cathook/data/chatcommands>\n");
g_ICvar->ConsoleColorPrintf(MENU_COLOR, "usage: chatcommands_add <chat command> <filename in " DATA_PATH "/chatcommands>\n");
return;
}
std::string prefix = args.Arg(1);

View File

@ -383,7 +383,7 @@ void generate_schema()
{
std::ifstream in("tf/scripts/items/items_game.txt");
std::string outS((std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>());
std::ofstream out("/opt/cathook/data/items_game.txt");
std::ofstream out(DATA_PATH "/items_game.txt");
std::regex a("\"equip_regions?\".*?\".*?\"");
std::regex b("\"equip_regions?\"\\s*?\\n\\s*?\\{[\\s\\S\\n]*?\\}");
outS = std::regex_replace(outS, a, "");
@ -400,7 +400,7 @@ void Schema_Reload()
static auto BInitTextBuffer = reinterpret_cast<bool (*)(void *, CUtlBuffer &, int)>(gSignatures.GetClientSignature("55 89 E5 57 56 53 8D 9D ? ? ? ? 81 EC ? ? ? ? 8B 7D ? 89 1C 24 "));
void *schema = (void *) ((unsigned) GetItemSchema() + 0x4);
FILE *file = fopen("/opt/cathook/data/items_game.txt", "r");
FILE *file = fopen(DATA_PATH "/items_game.txt", "r");
if (!file || ferror(file) != 0)
{
logging::Info("Error loading file");