@as239
or simply WriteByte(..., 0xEB) ; WriteWord(..., 0x9090)
Out of the two, I would try 0xEB patch, 0x9090 left more holes in
the single seed I examined.
@Ben80
Virtual table is only different for some objects, in most cases they will all have the same virtual table and therefore same functions.
RMG_Object is the base case and looks like the structure you've written, but for example Monster and Towns inherit its properties and have some additional fields for data afterwards.
- Код: Выделить всё
struct RMG_ObjectTown : public RMG_Object
{
// * +1C
INT32 indexOnMap;
// * +20
INT32 owner;
// * +24
BOOL8 hasFort;
UINT8 _f_25[3];
};
Expanded, it reads like this:
- Код: Выделить всё
struct RMG_ObjectTown
{
struct RMG_Object
{
// * +0
h3func *vTable;
// * +4
RMG_ObjectPropsRef *properties;
// * +8
INT32 x;
// * +C
INT32 y;
// * +10
INT32 z;
UINT8 _f_14[8];
}base;
// * +1C
INT32 indexOnMap;
// * +20
INT32 owner;
// * +24
BOOL8 hasFort;
UINT8 _f_25[3];
};
For these special inheritance cases, a new virtual table exists as it could:
1) have different constructor / destructor or any other personal function that is normally used
2) more virtual functions
For example, HiHook is a public Patch and has the same base virtual functions, but it also has extra virtual functions. So the value of its vTable would be different even if the first 5 virtual functions are the same.
However LoHook is 100% a public Patch and should have the exact same vTable.
If you want to inspect which functions are responsible for doing what, I recommend skipping some function calls from
RMG_ChooseTemplateAndGenerate_00549E20 to see their effects.
Also, fixed seed really helps!
e.g.
RMG_ToPlaceTowns_00544F40
RMG_ToPlaceMines_00546450
RMG_GenerateObjects_00547850
RMG_SetShoreMapItems_005317E0
RMG_PlaceObstacles_00537E60
RMG_PlaceRoads_00548780
RMG_WatermillRiver_00549D60
EDIT:
Another interesting one.
RMG_ClearSomePaths_00540AC0
Cancelled call at 0x54A100 vs allowed: