Water damage anywhere bug for hovers

Water damage anywhere bug for hovers

Discuss your problems with the latest release of the engine here. Problems with games, maps or other utilities belong in their respective forums.

Moderator: Moderators

Post Reply
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Water damage anywhere bug for hovers

Post by Buggi »

I found this while working on my latest mars map.

It seems hovercraft sustain damage as set by "waterdamage" no matter where they are.

Video :
http://www.epicedit.com/waterdamage.avi

I'm going to dive into code, but I have a hunch that SJ knows just where to look ;)

-Buggi
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

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
SJ
Posts: 618
Joined: 13 Aug 2004, 17:13

Post by SJ »

Hm hovers are suposed to have physicalstate::hovering not floating, only boars should have floating.

Fixed now.
User avatar
Buggi
Posts: 875
Joined: 29 Apr 2005, 07:46

Post by Buggi »

Can you commit the fixes to CVS?

It seems there have been no updates to the CVS in days. I'm starting to wonder if it isn't on purpose. :cry:

-Buggi
Post Reply

Return to “Help & Bugs”