Describe the bug
Sometimes my models dont get replaced, it looks like certain object IDs are more often affected than others.
To reproduce
-Start Map editor
-Open map file "testmap"
-Move your camera to the object called "CAMERA POSITION"
-Look at the object called "LOOK AT ME FOR _NO_ BUG"
-Start "megabug" resource
-See that the objects are replaced fine
-Look at the object called "LOOK AT ME FOR BUG"
-Restart megabug resource
-Turn the camera around, look at the objects and see the bug
-Restart megabug again while looking at the objects, see how they get replaced once again fine
Reproduction resources
-The testmap
testmap.zip
-The object replacer
megabug.zip
Additional context
When i dont replace objects 3902 and 3903, the others get replaced fine, you can test that by simply removing these two from the replacement list in "megabug" resource
Expected behaviour
Objects getting replaced fine
Screenshot

Multi Theft Auto v1.5.7-release-20506
Please upload the image to GitHub and embed by pasting (ctrl-v) straight into the issue edit box
I feel like this is a duplicate of your issue #1183 (@Einheit-101), let's compare this issue:
it looks like certain object IDs are more often affected than others
object 3915 not getting replaced very often, especially when not exactly looking at the object when it gets replaced
with this from your previous issue:
fails for some very special objects when the game is minimized, maybe it fails when the object is not streamed in either. A very common object is 3916 (snowover04). The object will get replaced as soon as it streams out and in again.
The strange thing is, most objects will always get replaced correctly, some objects are more likely to get this bug.
So in this issue it's object ID 3915, and in the previous issue it's ID 3916.. and the synopsis sort of matches. I still think that it's an issue with your gamemode, we tested previously, also in #dev if i recall correctly (couldn't repro) and no one else has come forward with this other than you.
But correct me if I'm wrong about it being the same thing.. then please clarify the difference between the issues.
The problem is similar, maybe caused by the same bug, but now i have that bug in the Editor and i can reproduce it perfectly fine. If i dont look at the object, it doesnt get replaced. If i look at it and restart the replacement resource, it works fine. A minimized MTA counts probably as "not looking at it".
Maybe its a quantum physics problem, Schr枚dingers Object 馃槀
As said, i will finish a test resource soon
updated topic with reproduction resources.
Please anyone tell me that you can reproduce it now... It drives me crazy.
updated topic with reproduction resources.
Please anyone tell me that you can reproduce it now... It drives me crazy.
I can reproduce it

I remember debugging CModelInfoSA class, and there was some weird bug with the model Ids. I thought I was imagining things and ignored it, but maybe that might be causing it. Hopefully, I'll have some free time by next week to look into this issue.
The issue is strange, if you clone the object with "C" in the editor, you get a copy of the object that is correctly replaced. So you have 1 bugged object that was there BEFORE you replaced it and you have 1 new object that works fine. It looks like MTA simply needs to stream all objects on screen in again after replacing them and in some cases it doesnt do that automatically. Maybe it is related with a specific object flag (because this bug only affects certain objects)
Fixed via #1735
@Einheit-101 can you confirm this fixed it for you? :) Thanks!
I did 1 small test and the error did not occur, but keep in mind that 1 test may not be sufficient.
Most helpful comment
The problem is similar, maybe caused by the same bug, but now i have that bug in the Editor and i can reproduce it perfectly fine. If i dont look at the object, it doesnt get replaced. If i look at it and restart the replacement resource, it works fine. A minimized MTA counts probably as "not looking at it".
Maybe its a quantum physics problem, Schr枚dingers Object 馃槀
As said, i will finish a test resource soon