summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Stein <fenstein12@googlemail.com>2016-12-30 00:06:30 +0100
committerMattes D <github@xoft.cz>2016-12-30 00:06:30 +0100
commitc8b1d8a37d6073786df34836ed1e2c88652ac629 (patch)
treea900470a39509b2a32cf042da788c6d4891d1217 /src
parentAdded 1.11 blocks, items and recipes (#3500) (diff)
downloadcuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.tar
cuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.tar.gz
cuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.tar.bz2
cuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.tar.lz
cuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.tar.xz
cuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.tar.zst
cuberite-c8b1d8a37d6073786df34836ed1e2c88652ac629.zip
Diffstat (limited to 'src')
-rw-r--r--src/Entities/Pawn.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Entities/Pawn.cpp b/src/Entities/Pawn.cpp
index b7fab31c3..0a9abcdc1 100644
--- a/src/Entities/Pawn.cpp
+++ b/src/Entities/Pawn.cpp
@@ -57,9 +57,6 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
cEntityEffect::eType EffectType = iter->first;
cEntityEffect * Effect = iter->second;
- // Call OnTick later to make sure the iterator won't be invalid
- EffectsToTick.push_back(Effect);
-
// Iterates (must be called before any possible erasure)
++iter;
@@ -68,6 +65,11 @@ void cPawn::Tick(std::chrono::milliseconds a_Dt, cChunk & a_Chunk)
{
RemoveEntityEffect(EffectType);
}
+ // Call OnTick later to make sure the iterator won't be invalid
+ else
+ {
+ EffectsToTick.push_back(Effect);
+ }
// TODO: Check for discrepancies between client and server effect values
}