mtasa-blue
mtasa-blue copied to clipboard
Fix random foliage on replaced collisions
This PR introduces fix for random foliage on custom collisions.
This is how custom model and custom collision looks like on current MTA version:
This is how it looks after this fix:
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
Also, does randomfoliage world property affect this?
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
There is engineSetSurfaceProperties
function with disabled createobjects
and createplants
flag:
https://github.com/multitheftauto/mtasa-blue/blob/cd1d2088a92b685b3b6294acb388fc1154ddbee4/Client/mods/deathmatch/logic/lua/CLuaFunctionParseHelpers.cpp#L611-L615 https://github.com/multitheftauto/mtasa-blue/blob/ebf54d4fcfe9b0b5600c2b632595029ea97f2b3f/Client/mods/deathmatch/logic/luadefs/CLuaEngineDefs.cpp#L1280-L1288 Maybe it could be fixed.
//edit: I have created issue about that: #2681.
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
Appropriate materials assigned in the collision are required for this to generate. Most servers use material 0 in their collisions, so I think lua function is unnecessary.
Also, does randomfoliage world property affect this?
setWorldSpecialPropertyEnabled
works fine with this
There is
engineSetSurfaceProperties
function with disabledcreateobjects
andcreateplants
flag:
But engineSetSurfaceProperties
works completely different.
This changes MTA current default behavior and may be unwanted in a number of cases so I think we should introduce some way (client-side Lua) to toggle this flag before merging as such.
Appropriate materials assigned in the collision are required for this to generate. Most servers use material 0 in their collisions, so I think lua function is unnecessary.
Also, does randomfoliage world property affect this?
setWorldSpecialPropertyEnabled
works fine with thisThere is
engineSetSurfaceProperties
function with disabledcreateobjects
andcreateplants
flag:But
engineSetSurfaceProperties
works completely different.
Ok thanks for clarification. I think we just need to test this and try the existing property function on this.
Great find all in all.
Fixes #2694
When you unload the resource, the foliage stays there. Probably should be fixed, but can be worked around by warping out of stream distance and warping back (and maybe some other method). engineRestreamWorld did not remove the foliage.
When you unload the resource, the foliage stays there. Probably should be fixed, but can be worked around by warping out of stream distance and warping back (and maybe some other method). engineRestreamWorld did not remove the foliage.
Foliage also stays when you use removeWorldModel in current MTA version on original models, so this is not an issue with this PR.
Foliage also stays when you use removeWorldModel in current MTA version on original models, so this is not an issue with this PR.
Thanks for clarifying. Maybe we'll create a new issue for that.