I think I found it. 99% sure anyway.
Code: Select all
if(uh->waterDamage && (physicalState==CSolidObject::Floating || (physicalState==CSolidObject::OnGround && pos.y<=-3 && readmap->halfHeightmap[int((pos.z/(SQUARE_SIZE*2))*gs->hmapx+(pos.x/(SQUARE_SIZE*2)))]<-1))){
DoDamage(DamageArray()*uh->waterDamage,0,ZeroVector);
}
I think that OR ( || ) should be an AND ( && ) otherwise that will always be true with hovers. It's always floating, so that'd be TRUE AND (TRUE OR FALSE) = TRUE AND TRUE = hovers exploding ALL over the place.
Or, just take the floating off entirelly. But that would spawn another but where hovers wouldn't take damage even over something they should be taking damage. :-\
So maybe something like this?
Code: Select all
if(uh->waterDamage && ((physicalState==CSolidObject::Floating || physicalState==CSolidObject::OnGround) && pos.y<=-3 && readmap->halfHeightmap[int((pos.z/(SQUARE_SIZE*2))*gs->hmapx+(pos.x/(SQUARE_SIZE*2)))]<-1))){
DoDamage(DamageArray()*uh->waterDamage,0,ZeroVector);
}
Which in my video, over ground would yield
if (TRUE AND ((TRUE) AND FALSE)) = FALSE
And over water would be
if (TRUE AND ((TRUE) AND TRUE)) = TRUE
*edit*
I tested two different types of IF statements as mentioned above and both caused there to be no damage to hovers over land, but it also no damage over water. :-/
Not sure where to look now.
*/edit*
-Buggi