1
0
mirror of https://github.com/zenorogue/hyperrogue.git synced 2025-07-16 08:02:51 +00:00

2d3d:: inertia movement now takes rotation into account

This commit is contained in:
Zeno Rogue 2019-05-11 20:15:30 +02:00
parent d3f10e8e30
commit 5fbdeaa89d

View File

@ -1786,8 +1786,16 @@ void movePlayer(monster *m, int delta) {
avg_inertia = m->inertia; avg_inertia = m->inertia;
ld coef = m->base->land == laWestWall ? 0.65 : falling ? 0.15 : 1; ld coef = m->base->land == laWestWall ? 0.65 : falling ? 0.15 : 1;
coef /= 1000; coef /= 1000;
m->inertia[frontdir()] += coef * playergo[cpid]; if(WDIM == 3) {
avg_inertia[frontdir()] += coef * playergo[cpid] / 2; m->inertia[frontdir()] += coef * playergo[cpid];
avg_inertia[frontdir()] += coef * playergo[cpid] / 2;
}
else {
m->inertia[0] += cos(godir[cpid]) * coef * playergo[cpid];
avg_inertia[0] += cos(godir[cpid]) * coef * playergo[cpid] / 2;
m->inertia[1] -= sin(godir[cpid]) * coef * playergo[cpid];
avg_inertia[1] -= sin(godir[cpid]) * coef * playergo[cpid] / 2;
}
if(falling) { if(falling) {
vector<cell*> below; vector<cell*> below;
manual_celllister mcl; manual_celllister mcl;