View Issue Details

IDProjectCategoryView StatusLast Update
0004217Multi Theft Auto : San AndreasClientpublic2009-05-28 19:20
Reporterlucasc190Assigned To 
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version1.0 
Summary0004217: setSkyGradient Glitch

When you use setSkyGradient, GTA stops setting all of the other world colours (water colour, brightness, etc). This can be fixed by instead of writing return to the start of the function that sets the world colours (0x561760), hooking the existing return at the end of the function (0x561795) and setting MTA's custom world colours here: (In CMultiplayerSA.cpp)

static void _declspec(naked) extraWorldColoursHook()
if (usingCustomSkyGradient) //Check if a custom sky gradient is being used
(SHORT)(0x77C4C4) = skyGradientTopR;
(SHORT)(0x77C4C4+2) = skyGradientTopG;
(SHORT)(0x77C4C4+4) = skyGradientTopB;
(SHORT)(0x77C4CA) = skyGradientBottomR;
(SHORT)(0x77C4CA+2) = skyGradientBottomG;
(SHORT)(0x77C4CA+4) = skyGradientBottomB;
if (usingCustomWaterColour) //Check if a custom water colour is being used
(FLOAT)(0xB7C508) = waterColourR;
(FLOAT)(0xB7C508+4) = waterColourG;
(FLOAT)(0xB7C508+8) = waterColourB;
(FLOAT)(0xB7C508+12) = waterColourA;
if (usingCustomFarClipDistance) //Check if a custom far clip distance is being used
(FLOAT)(0xB7C4F0) = farClipDistance;
if (usingCustomFogDistance) //Check if a custom fog distance is being used
(FLOAT)(0xB7C4F4) = fogDistance;

HookInstall(0x00561795U, (DWORD)extraWorldColoursHook, 5); //When MTA first starts up, install a hook onto the end of the function that sets all world functions

TagsNo tags attached.


related to 0004060 closed New issues A way to set the world colours. 



2009-04-25 16:50

viewer   ~~0008918

Last edited: 2009-04-25 16:50

This watercolour feature would be cool for lava level!


2009-05-01 18:20

reporter   ~~0008971

I had a typo, "0x77C4C4" should have been "0xB7C4C4" and so on. I'm making a patch for this.


2009-05-01 19:23

reporter   ~~0008972

The patch is now at:


2009-05-06 11:44

reporter   ~~0009051

This issue can be marked as resolved now, as I have uploaded a patch and it has been accepted.

Issue History

Date Modified Username Field Change