Fix pointer values overwriting the wrong fields in special nodes
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -58,3 +58,6 @@ src/doxy/doxy_warnings.txt
|
|||||||
|
|
||||||
# Windows junk files
|
# Windows junk files
|
||||||
Thumbs.db
|
Thumbs.db
|
||||||
|
|
||||||
|
# Misc
|
||||||
|
oldstructs.txt
|
||||||
|
@@ -137,6 +137,7 @@
|
|||||||
<ClCompile Include="..\..\boe.text.cpp" />
|
<ClCompile Include="..\..\boe.text.cpp" />
|
||||||
<ClCompile Include="..\..\boe.town.cpp" />
|
<ClCompile Include="..\..\boe.town.cpp" />
|
||||||
<ClCompile Include="..\..\boe.townspec.cpp" />
|
<ClCompile Include="..\..\boe.townspec.cpp" />
|
||||||
|
<ClCompile Include="..\..\oldstructs.cpp" />
|
||||||
<ClCompile Include="..\..\pcedit\pc.editors.cpp" />
|
<ClCompile Include="..\..\pcedit\pc.editors.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@@ -162,5 +162,8 @@
|
|||||||
<ClCompile Include="..\..\boe.menus.win.cpp">
|
<ClCompile Include="..\..\boe.menus.win.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\oldstructs.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
@@ -2007,11 +2007,11 @@ void run_special(eSpecCtx which_mode,short which_type,short start_spec,location
|
|||||||
if(cur_node.sd1 <= -10) cur_node.sd1 = univ.party.get_ptr(-cur_node.sd1);
|
if(cur_node.sd1 <= -10) cur_node.sd1 = univ.party.get_ptr(-cur_node.sd1);
|
||||||
if(cur_node.sd2 <= -10) cur_node.sd2 = univ.party.get_ptr(-cur_node.sd2);
|
if(cur_node.sd2 <= -10) cur_node.sd2 = univ.party.get_ptr(-cur_node.sd2);
|
||||||
if(cur_node.ex1a <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1a);
|
if(cur_node.ex1a <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1a);
|
||||||
if(cur_node.ex1b <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1b);
|
if(cur_node.ex1b <= -10) cur_node.ex1b = univ.party.get_ptr(-cur_node.ex1b);
|
||||||
if(cur_node.ex1c <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex1c);
|
if(cur_node.ex1c <= -10) cur_node.ex1c = univ.party.get_ptr(-cur_node.ex1c);
|
||||||
if(cur_node.ex2a <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex2a);
|
if(cur_node.ex2a <= -10) cur_node.ex2a = univ.party.get_ptr(-cur_node.ex2a);
|
||||||
if(cur_node.ex2b <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex2b);
|
if(cur_node.ex2b <= -10) cur_node.ex2b = univ.party.get_ptr(-cur_node.ex2b);
|
||||||
if(cur_node.ex2c <= -10) cur_node.ex1a = univ.party.get_ptr(-cur_node.ex2c);
|
if(cur_node.ex2c <= -10) cur_node.ex2c = univ.party.get_ptr(-cur_node.ex2c);
|
||||||
// TODO: Should pointers be allowed in message, pict, or jumpto as well?
|
// TODO: Should pointers be allowed in message, pict, or jumpto as well?
|
||||||
|
|
||||||
//print_nums(1111,cur_spec_type,cur_node.type);
|
//print_nums(1111,cur_spec_type,cur_node.type);
|
||||||
|
@@ -8,22 +8,27 @@
|
|||||||
|
|
||||||
#include "oldstructs.h"
|
#include "oldstructs.h"
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#ifndef _WIN32
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
using namespace legacy;
|
using namespace legacy;
|
||||||
|
|
||||||
#define STRUCT_INFO(what) \
|
#define STRUCT_INFO(what) \
|
||||||
log << #what << ": " << sizeof(what) << " bytes" << std::endl
|
what temp_##what; \
|
||||||
|
log << #what << ": " << sizeof(temp_##what) << " bytes" << std::endl
|
||||||
#define MEM_INFO(what,member) \
|
#define MEM_INFO(what,member) \
|
||||||
log << " " << #member << ": " << sizeof(what :: member) << " bytes, offset " \
|
log << " " << #member << ": " << sizeof(temp_##what . member) << " bytes, offset " \
|
||||||
<< offsetof(what,member) << std::endl
|
<< offsetof(what,member) << std::endl
|
||||||
|
|
||||||
// This is just a function to output all known information about each struct and its members.
|
// This is just a function to output all known information about each struct and its members.
|
||||||
void debug_oldstructs(); // Suppress "no prototype" warning
|
void debug_oldstructs(); // Suppress "no prototype" warning
|
||||||
void debug_oldstructs() {
|
void debug_oldstructs() {
|
||||||
|
#ifndef _WIN32
|
||||||
char cwd[256];
|
char cwd[256];
|
||||||
getcwd(cwd, 256);
|
getcwd(cwd, 256);
|
||||||
printf("%s" ,cwd);
|
printf("%s" ,cwd);
|
||||||
|
#endif
|
||||||
std::ofstream log("oldstructs.txt");
|
std::ofstream log("oldstructs.txt");
|
||||||
STRUCT_INFO(Rect);
|
STRUCT_INFO(Rect);
|
||||||
MEM_INFO(Rect,top);
|
MEM_INFO(Rect,top);
|
||||||
|
Reference in New Issue
Block a user