diff options
author | mathiascode <mathiascode@users.noreply.github.com> | 2017-02-26 01:31:08 +0100 |
---|---|---|
committer | Julian Laubstein <contact@julianlaubstein.de> | 2017-02-26 01:31:08 +0100 |
commit | 65ee749013795eb70f9069537ce0767b673755c8 (patch) | |
tree | 69048928a6dee45048da76918025fa0233cbd59a | |
parent | Fixed cactus detection and zombie pigman sword (#3584) (diff) | |
download | cuberite-65ee749013795eb70f9069537ce0767b673755c8.tar cuberite-65ee749013795eb70f9069537ce0767b673755c8.tar.gz cuberite-65ee749013795eb70f9069537ce0767b673755c8.tar.bz2 cuberite-65ee749013795eb70f9069537ce0767b673755c8.tar.lz cuberite-65ee749013795eb70f9069537ce0767b673755c8.tar.xz cuberite-65ee749013795eb70f9069537ce0767b673755c8.tar.zst cuberite-65ee749013795eb70f9069537ce0767b673755c8.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Protocol/Protocol_1_8.cpp | 22 | ||||
-rw-r--r-- | src/Protocol/Protocol_1_9.cpp | 22 |
2 files changed, 18 insertions, 26 deletions
diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp index b7310adb8..d55855c41 100644 --- a/src/Protocol/Protocol_1_8.cpp +++ b/src/Protocol/Protocol_1_8.cpp @@ -1707,9 +1707,8 @@ bool cProtocol_1_8_0::CompressPacket(const AString & a_Packet, AString & a_Compr int cProtocol_1_8_0::GetParticleID(const AString & a_ParticleName) { - static bool IsInitialized = false; static std::map<AString, int> ParticleMap; - if (!IsInitialized) + if (ParticleMap.empty()) { // Initialize the ParticleMap: ParticleMap["explode"] = 0; @@ -1733,7 +1732,7 @@ int cProtocol_1_8_0::GetParticleID(const AString & a_ParticleName) ParticleMap["dripwater"] = 18; ParticleMap["driplava"] = 19; ParticleMap["angryvillager"] = 20; - ParticleMap["happyVillager"] = 21; + ParticleMap["happyvillager"] = 21; ParticleMap["townaura"] = 22; ParticleMap["note"] = 23; ParticleMap["portal"] = 24; @@ -1754,16 +1753,13 @@ int cProtocol_1_8_0::GetParticleID(const AString & a_ParticleName) ParticleMap["droplet"] = 39; ParticleMap["take"] = 40; ParticleMap["mobappearance"] = 41; - ParticleMap["ironcrack"] = 42; - ParticleMap["blockcrack"] = 43; - ParticleMap["blockdust"] = 44; - ParticleMap["endRod"] = 45; - ParticleMap["dragonbreath"] = 46; - ParticleMap["damageIndicator"] = 47; - ParticleMap["sweepAttack"] = 48; - ParticleMap["fallingdust"] = 49; - ParticleMap["spit"] = 50; - ParticleMap["totem"] = 51; + ParticleMap["dragonbreath"] = 42; + ParticleMap["endrod"] = 43; + ParticleMap["damageindicator"] = 44; + ParticleMap["sweepattack"] = 45; + ParticleMap["fallingdust"] = 46; + ParticleMap["totem"] = 47; + ParticleMap["spit"] = 48; } AString ParticleName = StrToLower(a_ParticleName); diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 5b1b4472b..1d014d741 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -1724,9 +1724,8 @@ bool cProtocol_1_9_0::CompressPacket(const AString & a_Packet, AString & a_Compr int cProtocol_1_9_0::GetParticleID(const AString & a_ParticleName) { - static bool IsInitialized = false; static std::map<AString, int> ParticleMap; - if (!IsInitialized) + if (ParticleMap.empty()) { // Initialize the ParticleMap: ParticleMap["explode"] = 0; @@ -1750,7 +1749,7 @@ int cProtocol_1_9_0::GetParticleID(const AString & a_ParticleName) ParticleMap["dripwater"] = 18; ParticleMap["driplava"] = 19; ParticleMap["angryvillager"] = 20; - ParticleMap["happyVillager"] = 21; + ParticleMap["happyvillager"] = 21; ParticleMap["townaura"] = 22; ParticleMap["note"] = 23; ParticleMap["portal"] = 24; @@ -1771,16 +1770,13 @@ int cProtocol_1_9_0::GetParticleID(const AString & a_ParticleName) ParticleMap["droplet"] = 39; ParticleMap["take"] = 40; ParticleMap["mobappearance"] = 41; - ParticleMap["ironcrack"] = 42; - ParticleMap["blockcrack"] = 43; - ParticleMap["blockdust"] = 44; - ParticleMap["endRod"] = 45; - ParticleMap["dragonbreath"] = 46; - ParticleMap["damageIndicator"] = 47; - ParticleMap["sweepAttack"] = 48; - ParticleMap["fallingdust"] = 49; - ParticleMap["spit"] = 50; - ParticleMap["totem"] = 51; + ParticleMap["dragonbreath"] = 42; + ParticleMap["endrod"] = 43; + ParticleMap["damageindicator"] = 44; + ParticleMap["sweepattack"] = 45; + ParticleMap["fallingdust"] = 46; + ParticleMap["totem"] = 47; + ParticleMap["spit"] = 48; } AString ParticleName = StrToLower(a_ParticleName); |