August 12th Hotfix

Includes fix for infinite loop in FootClass::Detach
This commit is contained in:
PG-SteveT 2020-08-12 11:32:36 -07:00
parent ae72fce5dd
commit 1f6350fe6e
9 changed files with 38 additions and 10 deletions

View file

@ -302,6 +302,8 @@ class DLLExportClass {
static int CurrentDrawCount;
static int TotalObjectCount;
static int SortOrder;
static int ExportLayer;
static CNCObjectListStruct *ObjectList;
static CNC_Event_Callback_Type EventCallback;
@ -346,6 +348,7 @@ class DLLExportClass {
int DLLExportClass::CurrentDrawCount = 0;
int DLLExportClass::TotalObjectCount = 0;
int DLLExportClass::SortOrder = 0;
int DLLExportClass::ExportLayer = 0;
CNCObjectListStruct *DLLExportClass::ObjectList = NULL;
SidebarGlyphxClass DLLExportClass::MultiplayerSidebars [MAX_PLAYERS];
uint64 DLLExportClass::GlyphxPlayerIDs[MAX_PLAYERS] = {0xffffffffl};
@ -1109,6 +1112,8 @@ void GlyphX_Assign_Houses(void)
strncpy(housep->IniName, Text_String(TXT_COMPUTER), HOUSE_NAME_MAX);
housep->IQ = Rule.MaxIQ;
//housep->Control.TechLevel = _build_tech[BuildLevel];
} else {
housep->IQ = 0;
}
@ -3313,7 +3318,11 @@ void DLLExportClass::DLL_Draw_Intercept(int shape_number, int x, int y, int widt
new_object.CNCInternalObjectPointer = (void*)object;
new_object.OccupyListLength = 0;
new_object.SortOrder = SortOrder++;
if (CurrentDrawCount == 0) {
new_object.SortOrder = (ExportLayer << 29) + (object->Sort_Y() >> 3);
} else {
new_object.SortOrder = ObjectList->Objects[TotalObjectCount].SortOrder + CurrentDrawCount;
}
strncpy(new_object.TypeName, object->Class_Of().IniName, CNC_OBJECT_ASSET_NAME_LENGTH);
@ -3700,6 +3709,8 @@ bool DLLExportClass::Get_Layer_State(uint64 player_id, unsigned char *buffer_in,
*/
for (int layer = 0; layer < DLL_LAYER_COUNT; layer++) {
ExportLayer = layer;
for (int index = 0; index < Map.Layer[layer].Count(); index++) {
ObjectClass *object = Map.Layer[layer][index];