Merge devel into master (#78)

* * Turn survival back on for now.

* * Add TP command.

* * Fix fall damage reset.

* * Mob hitting works.

I've disabled entity shading though. Will get back to it at some point, promise!

* * Knockback

* * Mobs now rotate when they die.

* * Fire fix
This commit is contained in:
iProgramInCpp
2023-09-17 12:47:09 +03:00
committed by GitHub
parent e9b00e6ba1
commit 350100ac48
15 changed files with 225 additions and 8 deletions

View File

@@ -64,6 +64,16 @@ void MobRenderer::setupPosition(Entity* entity, float x, float y, float z)
void MobRenderer::setupRotations(Entity* entity, float x, float y, float z)
{
glRotatef(180.0f - y, 0.0f, 1.0f, 0.0f);
Mob* mob = (Mob*)entity;
if (mob->field_110 > 0)
{
float t = Mth::sqrt((float(mob->field_110) + z - 1.0f) / 20.0f * 1.6f);
if (t > 1.0f)
t = 1.0f;
glRotatef(getFlipDegrees(mob) * t, 0.0f, 0.0f, 1.0f);
}
}
void MobRenderer::render(Entity* entity, float x, float y, float z, float unused, float f)
@@ -116,7 +126,7 @@ void MobRenderer::render(Entity* entity, float x, float y, float z, float unused
if (pMob->field_104 > 0 || pMob->field_110 > 0)
{
glColor4f(fBright, 0.0f, 0.0f, 0.4f);
m_pModel->render(x2, x1, fBob, aYaw - fSmth, aPitch, 0.0625f);
m_pModel->render(x2, x1, fBob, aYaw - fSmth, aPitch, 0.059375f); // was 0.0625f. Why?
}
if (GET_ALPHA(iOverlayColor))
{
@@ -126,7 +136,7 @@ void MobRenderer::render(Entity* entity, float x, float y, float z, float unused
float(GET_BLUE(iOverlayColor)) / 255.0f,
float(GET_ALPHA(iOverlayColor)) / 255.0f);
m_pModel->render(x2, x1, fBob, aYaw - fSmth, aPitch, 0.0625f);
m_pModel->render(x2, x1, fBob, aYaw - fSmth, aPitch, 0.059375f); // same here
}
glDepthFunc(GL_LEQUAL);