parent
7b2d096207
commit
1f49026198
3 changed files with 5 additions and 3 deletions
|
|
@ -66,8 +66,8 @@ private:
|
|||
#if defined (CR_WINDOWS)
|
||||
DWORD oldProt;
|
||||
|
||||
FlushInstructionCache (GetCurrentProcess (), orig, m_pageSize);
|
||||
return VirtualProtect (orig, m_pageSize, PAGE_EXECUTE_READWRITE, &oldProt);
|
||||
FlushInstructionCache (GetCurrentProcess (), orig, CodeLength);
|
||||
return VirtualProtect (orig, CodeLength, PAGE_EXECUTE_READWRITE, &oldProt);
|
||||
#else
|
||||
auto aligned = align (orig);
|
||||
return !mprotect (aligned, m_pageSize, PROT_READ | PROT_WRITE | PROT_EXEC);
|
||||
|
|
|
|||
|
|
@ -406,7 +406,9 @@ namespace TaskPri {
|
|||
|
||||
// storage file magic
|
||||
constexpr char kPodbotMagic[8] = "PODWAY!";
|
||||
|
||||
constexpr int32 kStorageMagic = 0x59415042;
|
||||
constexpr int32 kStorageMagicUB = 0x544f4255; // storage magic for ubot-data files
|
||||
|
||||
constexpr float kInfiniteDistance = 9999999.0f;
|
||||
constexpr float kGrenadeCheckTime = 2.15f;
|
||||
|
|
|
|||
|
|
@ -1636,7 +1636,7 @@ template <typename U> bool BotGraph::loadStorage (const String &ext, const Strin
|
|||
file.read (&hdr, sizeof (StorageHeader));
|
||||
|
||||
// check the magic
|
||||
if (hdr.magic != kStorageMagic) {
|
||||
if (hdr.magic != kStorageMagic && hdr.magic != kStorageMagicUB) {
|
||||
if (tryReload ()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue