forked from teamnwah/openmw-tes3coop
[Client] Don't store multiple cellStates for the same cell
This commit is contained in:
parent
a2e3fe18fe
commit
57f54aa370
1 changed files with 14 additions and 0 deletions
|
@ -1098,6 +1098,20 @@ void LocalPlayer::clearCellStates()
|
||||||
|
|
||||||
void LocalPlayer::storeCellState(ESM::Cell cell, int stateType)
|
void LocalPlayer::storeCellState(ESM::Cell cell, int stateType)
|
||||||
{
|
{
|
||||||
|
std::vector<CellState>::iterator iter;
|
||||||
|
|
||||||
|
for (iter = cellStateChanges.cellStates.begin(); iter != cellStateChanges.cellStates.end(); )
|
||||||
|
{
|
||||||
|
// If there's already a cell state recorded for this particular cell,
|
||||||
|
// remove it
|
||||||
|
if (cell.getDescription() == (*iter).cell.getDescription())
|
||||||
|
{
|
||||||
|
iter = cellStateChanges.cellStates.erase(iter);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
++iter;
|
||||||
|
}
|
||||||
|
|
||||||
CellState cellState;
|
CellState cellState;
|
||||||
cellState.cell = cell;
|
cellState.cell = cell;
|
||||||
cellState.type = stateType;
|
cellState.type = stateType;
|
||||||
|
|
Loading…
Reference in a new issue