Modified SineGun shot bug/error

2 replies [Last post]
KIRA
KIRA's picture
User offline. Last seen 6 weeks 6 hours ago. Offline
Joined: 2014-09-23
Posts: 155

I am making a script with a hog that has a SineGun modified with SetGearValues: The "Radius" and the "Boom" of the sinegunshot are set to 0 so that the weapon is used not for doing damage but for moving around the map with the blast wave of the recoil but this cause a game crash if you aim with the sight at an hog. Idk if this is fixable or if it is worth fixing. Thanks

nemo
nemo's picture
User offline. Last seen 10 weeks 2 days ago. Offline
Joined: 2009-01-28
Posts: 1863

Why did you change the Radius? It just shoves hogs around a little.

Anyway, eyeballing the code, it seems pretty sensitive to the Radius values. specifically.

else if (Gear^.Radius > 1) then
begin
if (Gear^.Health <= (initHealth div 6)) then
dec(Gear^.Radius)
end;
Does not do a zero check, which would probably underflow the radius on the dec.

I'd suggest Radius of 1, Health of 1, Damage of 0 based on the code, but maybe look over that function.

Changing Radius probably not necessary.

--
Oh, what the heck. 1PLXzL1CBUD1kdEWqMrwNUfGrGiirV1WpH <= tip a hedgewars dev

KIRA
KIRA's picture
User offline. Last seen 6 weeks 6 hours ago. Offline
Joined: 2014-09-23
Posts: 155

Of what you said I only understood to set the radius to 1 so I did that and now seems to work fine.
Thank you very much

User login

Copyright © 2004-2024 Hedgewars Project. All rights reserved. [ contact ]