mtasa-blue
mtasa-blue copied to clipboard
createBuilding crash 0x000096AD
Describe the bug
createBuilding crash
Steps to reproduce
- Use createBuilding()
- Fly around the map
Version
Multi Theft Auto v1.6-release-22410
Additional context
https://mega.nz/file/wQRUDZYB#NHP447diX6cCtgr7Yu8MuI96P_CjWKa4kQQx7M6Q7fM
Relevant log output
No response
Security Policy
- [X] I have read and understood the Security Policy and this issue is not security related.
I was only able to reproduce it when I created a lot of buildings at once.
I see that when the error message about running out of slots appears, the game crashes. Otherwise, not really.
I was only able to reproduce it when I created a lot of buildings at once.
Same crash with 5 and 2000 buildings. I've created 5 buildings (cityhall ls), and crashed at chilliad wood house
@Xenius97 can you provide test resource, please? I knew about crashes with more than 2000 buildings, but it always works well for me with 5 buildings
removeWorldModel(3997, 10000, 0, 0, 0)
removeWorldModel(4045, 10000, 0, 0, 0)
createBuilding(3997, 1479.3359375, -1802.2890625, 12.546875, 0, 0, 0)
removeWorldModel(4163, 10000, 0, 0, 0)
removeWorldModel(4164, 10000, 0, 0, 0)
createBuilding(4163, 1469.3359375, -1732.2890625, 12.4609375, 0, 0, 0)
removeWorldModel(4186, 10000, 0, 0, 0)
removeWorldModel(4057, 10000, 0, 0, 0)
createBuilding(4186, 1479.5546875, -1693.140625, 19.578125, 0, 0, 0)
removeWorldModel(3985, 10000, 0, 0, 0)
removeWorldModel(4210, 10000, 0, 0, 0)
createBuilding(3985, 1479.5625, -1631.453125, 12.078125, 0, 0, 0)
removeWorldModel(3978, 10000, 0, 0, 0)
removeWorldModel(4053, 10000, 0, 0, 0)
createBuilding(3978, 1380.265625, -1655.5390625, 10.8046875, 0, 0, 0)
removeWorldModel(4029, 10000, 0, 0, 0)
removeWorldModel(4136, 10000, 0, 0, 0)
createBuilding(4029, 1629.546875, -1756.0859375, 8.09375, 0, 0, 0)
Tried to reproduce again, but i can't. I don't know what was wrong, maybe not buildings.
Found the issue. Create a few buildings in one resource, then restart it a few times and crash.
I hope #3330 fixes this case too.
@TheNormalnij You could try clearing the references to the building perhaps. (See CEntity::ResolveReferences
)
@TheNormalnij okay, so I've looked into the crash log, and it's here:
https://github.com/gta-reversed/gta-reversed-modern/blob/e3219aeccec725c939c13f27e9ecd338d70e5b8d/source/game_sa/Streaming.cpp#L188
Seems like you aren't calling DeleteRwObject
anywhere (which would remove the entity's streaming link).
I've tested it but didn't crash with this offset, so i think its solved.