Skip to content

Commit e6cf38d

Browse files
authored
fix diving bugs (#335)
reset camera when diving to water surface align health reduction after diving time is over to vanilla behavior (approx. -10/s)
1 parent aeb9038 commit e6cf38d

3 files changed

Lines changed: 3 additions & 3 deletions

File tree

game/camera.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void Camera::setMode(Camera::Mode m) {
108108
if(camMod==m)
109109
return;
110110

111-
const bool reset = (m==Inventory || camMod==Inventory || camMod==Dialog);
111+
const bool reset = (m==Inventory || camMod==Inventory || camMod==Dialog || camMod==Dive);
112112
camMod = m;
113113

114114
if(reset)

game/game/movealgo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ void MoveAlgo::tickSwim(uint64_t dt) {
254254
auto ground = dropRay (pos+dp+Tempest::Vec3(0,fallThreshold,0), valid);
255255
auto water = waterRay(pos+dp+Tempest::Vec3(0,fallThreshold,0), &validW);
256256

257-
if(npc.isDead()){
257+
if(npc.isDead()) {
258258
setAsSwim(false);
259259
setAsDive(false);
260260
return;

game/world/objects/npc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1955,7 +1955,7 @@ void Npc::tick(uint64_t dt) {
19551955
t-=v;
19561956
int dmg = t/tickSz - (t-int(dt))/tickSz;
19571957
if(dmg>0)
1958-
changeAttribute(ATR_HITPOINTS,-100*dmg,false);
1958+
changeAttribute(ATR_HITPOINTS,-dmg,false);
19591959
}
19601960
}
19611961
}

0 commit comments

Comments
 (0)