Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: Rampage on December 18, 2002, 05:59:20 pm

Title: Shield Bug and Beam Cannons
Post by: Rampage on December 18, 2002, 05:59:20 pm
FS2 Open Source Programmers:

I don't know if someone had mentioned this before, but here it is.

When a beam cannon fires, regardless of IFF or target, all ships with shields lose one quadrant of their shields.  Of course these quadrants will recharge, it's still a pain to you (and death to your enemy fighters).

Has anyone reported this bug yet?
Title: Shield Bug and Beam Cannons
Post by: Sesquipedalian on December 18, 2002, 06:28:20 pm
They have. :nod:
Not sure who is fixing it though, or if it already has been, or what.
Title: Shield Bug and Beam Cannons
Post by: DTP on December 18, 2002, 06:32:57 pm
yeah, but i seem to have observed that sometimes, to who you have become a traitor sometimes loses all of Their shield power for some reason. i guees i will have to try and nail this bug.
Title: Shield Bug and Beam Cannons
Post by: Bobboau on December 19, 2002, 12:41:51 am
it may have to do with the beam shield hit code,
but, it shouldn't
Title: Shield Bug and Beam Cannons
Post by: Inquisitor on December 19, 2002, 09:04:52 am
it's in bugzilla. DTP, can you have a look at it? I thought it was something Bobboau had fixed, but it sounds like it might be unrelated.
Title: Shield Bug and Beam Cannons
Post by: DTP on December 19, 2002, 06:20:05 pm
you will all be happy to know, that i have nailed the bug. :D

seems i like to be a starship trooper. :)

But the sad news is that it is in Bobboau´s fighter beam code.  :(

Code: [Select]

if(test_collide.flags & MC_CHECK_SHIELD){ //if we're checking sheilds
int quad = get_quadrant(&test_collide.hit_point);//find wich quadrant we hit
if(Objects[shipp->objnum].shields[quad] < (bwi->damage * bwi->shield_factor * 2.0f)){
//then if the beam does more damage than that quadrant can take
//if(!(ship_is_shield_up(&Objects[shipp->objnum], get_quadrant(&test_collide.hit_point)))){
//go through the shield and hit the hull -Bobboau
if(widest > pair->b->radius * BEAM_AREA_PERCENT){
test_collide.radius = beam_get_widest(b) * 0.5f;
test_collide.flags = MC_CHECK_MODEL | MC_CHECK_SPHERELINE;
} else {
test_collide.flags = MC_CHECK_MODEL | MC_CHECK_RAY;
}
model_collide(&test_collide);
Objects[shipp->objnum].shields[quad]=0.0f; //for good measure-Bobboau
}
}


notice the last line

Code: [Select]

Objects[shipp->objnum].shields[quad]=0.0f; //for good measure-Bobboau


i commented this out, and the bug dissapeared.

right know i´m studing the fighter beam collision code, in order to determine if this accidently getting checked for shield-beam fighter collision when a cap ship fires a Big beam that collides with another ship.

or if it is a bug the code was born with.

will report back asap
Title: Shield Bug and Beam Cannons
Post by: Bobboau on December 19, 2002, 06:41:22 pm
that bit of code wasn't realy necisary, I just added it in to make sure that the sheilds wouldn't stop a beam if they were super duper weak, feel free to mess with it
Title: Shield Bug and Beam Cannons
Post by: phreak on December 19, 2002, 06:52:16 pm
that'll do it