Skip to content

Commit

Permalink
prevent dyncol underwater
Browse files Browse the repository at this point in the history
  • Loading branch information
Sora-yx committed May 23, 2022
1 parent 2276915 commit d4ba1ae
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions SA2-Super-Sonic/water.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ void __cdecl SS_Water_Main(ObjectMaster* obj)
if (!co2)
return;

if (((co2->Upgrades & Upgrades_SuperSonic) == 0) || co2->Powerups & Powerups_Dead)
if (((co2->Upgrades & Upgrades_SuperSonic) == 0) || co2->Powerups & Powerups_Dead || co2->UnderwaterTime > 0)
{
DeleteObject_(obj);
return;
Expand Down Expand Up @@ -319,9 +319,11 @@ void __cdecl SplashEffect_r(ObjectMaster* a1)

void Load_SSWaterTask(char pid)
{
if (!waterColTask) {
waterColTask = LoadObject(2, "SS_Water_Eff", SS_Water_Main, LoadObj_Data1 | LoadObj_Data2);
waterColTask->Data1.Entity->Index = pid;
if (MainCharObj2[pid]) {
if (!waterColTask && MainCharObj2[pid]->UnderwaterTime == 0) {
waterColTask = LoadObject(2, "SS_Water_Eff", SS_Water_Main, LoadObj_Data1 | LoadObj_Data2);
waterColTask->Data1.Entity->Index = pid;
}
}
return;
}
Expand All @@ -334,7 +336,6 @@ void __cdecl Reload_SS_WaterTask(char charID, char pnum)
}
}


void LoadWaterTextures(char charID) {

if (isFakeWaterLevel())
Expand Down

0 comments on commit d4ba1ae

Please sign in to comment.