From 509d3d3b62c2dc5b328cf122c0fc5f0595b73721 Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 18 Jul 2014 16:55:28 +0200 Subject: Slime sizes are 1, 2 or 4 and not 1, 2 or 3. --- src/Mobs/Monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index e36634c73..2a796e8eb 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -867,7 +867,7 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType) } case mtSlime: { - toReturn = new cSlime(Random.NextInt(2) + 1); + toReturn = new cSlime(1 << Random.NextInt(3)); break; } case mtSkeleton: -- cgit v1.2.3 From 19d012c96ec13498d97d8e43136cc09eca3dca2e Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 18 Jul 2014 23:20:42 +0200 Subject: Fixed slime-related comments. --- src/Mobs/Monster.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 2a796e8eb..19851e064 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -867,13 +867,13 @@ cMonster * cMonster::NewMonsterFromType(cMonster::eType a_MobType) } case mtSlime: { - toReturn = new cSlime(1 << Random.NextInt(3)); + toReturn = new cSlime(1 << Random.NextInt(3)); // Size 1, 2 or 4 break; } case mtSkeleton: { // TODO: Actual detection of spawning in Nether - toReturn = new cSkeleton(Random.NextInt(1) == 0 ? false : true); + toReturn = new cSkeleton((Random.NextInt(1) == 0) ? false : true); break; } case mtVillager: -- cgit v1.2.3 From 041bfd5860cd8ef51db42eb6fb4b50b45549feba Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 01:40:29 -0700 Subject: Fixed clamping issues --- src/Mobs/Monster.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index e6c82a448..8d612fbaa 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -414,11 +414,7 @@ void cMonster::HandleFalling() int cMonster::FindFirstNonAirBlockPosition(double a_PosX, double a_PosZ) { int PosY = POSY_TOINT; - - if (PosY < 0) - PosY = 0; - else if (PosY > cChunkDef::Height) - PosY = cChunkDef::Height; + PosY = Clamp(PosY, 0, cChunkDef::Height); if (!cBlockInfo::IsSolid(m_World->GetBlock((int)floor(a_PosX), PosY, (int)floor(a_PosZ)))) { -- cgit v1.2.3 From 00c524519ef6c7ceaf4ac91307617cfd65d7cf21 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sat, 19 Jul 2014 14:53:41 +0200 Subject: Fixed style: spaces after commas. --- src/Mobs/Monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 8d612fbaa..db45db5b9 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -126,7 +126,7 @@ void cMonster::TickPathFinding() { 1, 0}, {-1, 0}, { 0, 1}, - { 0,-1}, + { 0, -1}, } ; if ((PosY - 1 < 0) || (PosY + 2 > cChunkDef::Height) /* PosY + 1 will never be true if PosY + 2 is not */) -- cgit v1.2.3 From ada88a58053e74c910982f7c3ebdfb791161c110 Mon Sep 17 00:00:00 2001 From: archshift Date: Sat, 19 Jul 2014 14:35:35 -0700 Subject: Monsters: Made IsUndead overridable by the respective mob classes --- src/Mobs/Monster.cpp | 10 ---------- 1 file changed, 10 deletions(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index db45db5b9..753a44914 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -680,16 +680,6 @@ void cMonster::GetMonsterConfig(const AString & a_Name) bool cMonster::IsUndead(void) { - switch (GetMobType()) - { - case mtZombie: - case mtZombiePigman: - case mtSkeleton: - case mtWither: - { - return true; - } - } return false; } -- cgit v1.2.3 From 6be79575fd50e37ac275bd0cb9d16f9e51e8a225 Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Sun, 20 Jul 2014 23:10:31 +0200 Subject: Style: Normalized spaces after if, for and while. --- src/Mobs/Monster.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/Mobs/Monster.cpp') diff --git a/src/Mobs/Monster.cpp b/src/Mobs/Monster.cpp index 753a44914..c1247c1f8 100644 --- a/src/Mobs/Monster.cpp +++ b/src/Mobs/Monster.cpp @@ -281,7 +281,7 @@ void cMonster::Tick(float a_Dt, cChunk & a_Chunk) } Vector3f Distance = m_Destination - GetPosition(); - if(!ReachedDestination() && !ReachedFinalDestination()) // If we haven't reached any sort of destination, move + if (!ReachedDestination() && !ReachedFinalDestination()) // If we haven't reached any sort of destination, move { Distance.y = 0; Distance.Normalize(); -- cgit v1.2.3