Fix a crash in WaterRenderer.cpp
This fixes a rare crash at map generation. The water renderer could be left in an invalid state when exiting a game, and would then crash on the next map generation in some cases. Tested by: Stan Differential Revision: https://code.wildfiregames.com/D3447 This was SVN commit r24759.
This commit is contained in:
parent
993ccc6034
commit
f2b3c4d8ec
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2017 Wildfire Games.
|
||||
/* Copyright (C) 2021 Wildfire Games.
|
||||
* This file is part of 0 A.D.
|
||||
*
|
||||
* 0 A.D. is free software: you can redistribute it and/or modify
|
||||
@ -55,6 +55,9 @@ public:
|
||||
|
||||
virtual void Deinit()
|
||||
{
|
||||
// Clear the map size & data.
|
||||
if (CRenderer::IsInitialised())
|
||||
g_Renderer.GetWaterManager()->SetMapSize(0);
|
||||
}
|
||||
|
||||
virtual void Serialize(ISerializer& serialize)
|
||||
|
Loading…
Reference in New Issue
Block a user