multitheftauto / mtasa-blue

Multi Theft Auto is a game engine that incorporates an extendable network play element into a proprietary commercial single-player game.
https://multitheftauto.com
GNU General Public License v3.0
1.3k stars 412 forks source link

Add new functions related to underwater effects #3463

Open XJMLN opened 2 weeks ago

XJMLN commented 2 weeks ago

Client functions

Resolves #1297

Proxy-99 commented 2 weeks ago

Great! We can fix #2598 by checking if the underwater effect is on, maybe after this PR merged?

XJMLN commented 2 weeks ago

Currently, getCameraUnderwaterEffect will return true only if it was enabled by setCameraUnderwaterEffectEnabled. I don't know if this is valid; maybe I should additionally check the value of CWeather::UnderWaterness(0xC8132C), which is used to enable this effect and changing the weather to ID 20 while underwater. Then getCameraUnderwaterEffect would return true in that case.

Proxy-99 commented 2 weeks ago

Currently, getCameraUnderwaterEffect will return true only if it was enabled by setCameraUnderwaterEffectEnabled. I don't know if this is valid; maybe I should additionally check the value of CWeather::UnderWaterness(0xC8132C), which is used to enable this effect and changing the weather to ID 20 while underwater. Then getCameraUnderwaterEffect would return true in that case.

I think we should be able to check the effect anytime without relying on setCameraUnderwaterEffectEnabled

Proxy-99 commented 2 weeks ago

resetCameraUnderwaterEffect() should not this also reset darkness too

and getCameraUnderwaterEffect() should not also get the darkness level too instead of calling another function to check

TheNormalnij commented 2 weeks ago

Nice job! Reset effects when a player connect to a new server. please