mirror of https://github.com/OpenRCT2/OpenRCT2.git
Still trying to find bug
This commit is contained in:
parent
387ce00ae2
commit
81121db634
41
src/object.c
41
src/object.c
|
@ -45,25 +45,7 @@ int object_load(int groupIndex, rct_object_entry *entry)
|
|||
return 1;
|
||||
}
|
||||
for (int i = 0; i < RCT2_GLOBAL(0x00F42B6C, sint32); i++) {
|
||||
if (!(installedObject->flags & 0xF0)){
|
||||
if (entry->flags != installedObject->flags ||
|
||||
entry->checksum != installedObject->checksum ||
|
||||
strncmp(entry->name, installedObject->name, 8)){
|
||||
//6a9c06
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ((entry->flags & 0xF0) != (installedObject->flags & 0xF0) ||
|
||||
strncmp(entry->name, installedObject->name, 8)){
|
||||
//6a9c06
|
||||
}
|
||||
int eax = installedObject->flags >> 4;
|
||||
if ((eax & 0xFF) != 8){
|
||||
if (!(RCT2_GLOBAL(RCT2_ADDRESS_EXPANSION_FLAGS, uint16)&(1 << eax))){
|
||||
//6a9c06
|
||||
}
|
||||
}
|
||||
}
|
||||
if (object_entry_compare(installedObject, entry)){
|
||||
|
||||
char path[260];
|
||||
char *objectPath = (char*)installedObject + 16;
|
||||
|
@ -83,15 +65,15 @@ int object_load(int groupIndex, rct_object_entry *entry)
|
|||
// Read chunk
|
||||
int chunkSize = *((uint32*)pos);
|
||||
char *chunk;
|
||||
if (chunkSize == 0xFFFFFFFF) {
|
||||
//if (chunkSize == 0xFFFFFFFF) {
|
||||
chunk = malloc(0x600000);
|
||||
chunkSize = sawyercoding_read_chunk(file, chunk);
|
||||
chunk = realloc(chunk, chunkSize);
|
||||
}
|
||||
else {
|
||||
chunk = malloc(chunkSize);
|
||||
sawyercoding_read_chunk(file, chunk);
|
||||
}
|
||||
//}
|
||||
//else {
|
||||
// chunk = malloc(chunkSize);
|
||||
// chunkSize = sawyercoding_read_chunk(file, chunk);
|
||||
//}
|
||||
fclose(file);
|
||||
|
||||
// Calculate and check checksum
|
||||
|
@ -114,10 +96,10 @@ int object_load(int groupIndex, rct_object_entry *entry)
|
|||
free(chunk);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ebp = RCT2_GLOBAL(0xF42B84, uint16) & 0xF;
|
||||
//B84 is openedEntry
|
||||
int ebp = openedEntry.flags & 0x0F;
|
||||
int esi = RCT2_ADDRESS(0x98D97C, uint32)[ebp * 2];
|
||||
int ecx = RCT2_GLOBAL(0xF42B64, sint32);
|
||||
int ecx = groupIndex;
|
||||
if (ecx == -1){
|
||||
for (int ecx = 0; ((sint32*)esi)[ecx] != -1; ecx++){
|
||||
if ((ecx + 1) >= RCT2_ADDRESS(0x98DA00, uint16)[ebp]){
|
||||
|
@ -130,13 +112,14 @@ int object_load(int groupIndex, rct_object_entry *entry)
|
|||
((sint32*)esi)[ecx] = chunk;
|
||||
|
||||
int* edx = ecx * 20 + RCT2_ADDRESS(0x98D980, uint32)[ebp * 2];
|
||||
memcpy(edx, (int*)0xF42B84, 20);
|
||||
memcpy(edx, (int*)&openedEntry, 20);
|
||||
if (RCT2_GLOBAL(0x9ADAFD, uint8) == 0)return 1;
|
||||
object_paint(ecx, 0, ecx, ebp, 0, (int)chunk, 0, 0);
|
||||
return 1;
|
||||
}
|
||||
fclose(file);
|
||||
}
|
||||
}
|
||||
installedObject = object_get_next(installedObject);
|
||||
}
|
||||
//6a991f
|
||||
|
|
Loading…
Reference in New Issue