if (asProjNaybors[i].psObj->player != psObj->player &&
(asProjNaybors[i].psObj->type == OBJ_DROID ||
asProjNaybors[i].psObj->type == OBJ_STRUCTURE ||
asProjNaybors[i].psObj->type == OBJ_BULLET ||
asProjNaybors[i].psObj->type == OBJ_FEATURE) &&
Can't this be put down into classes? ( psObj->class )
Or mark all attackable OBJ_... via bitmask? ( psObj->type & CLS_ATTACKABLE
)
Or add a attackable option to the object? ( psObj->attackable )
maybe I'll change it to psObj->type != OBJ_TARGET(camera object),there is
only 5 'types' of objects,not need to do that imo.Also,psObj is
BASE_OBJECT,adding new option/flag to that struct might break many things
including netcode...
if ( psTempObj->type == OBJ_BULLET )
{
if ( !bMissile || (((PROJ_OBJECT *)psTempObj)->psWStats->weaponSubClass
!=
WSC_COUNTER) )
{
continue;
}
}
//Watermelon:dont apply the 'hitbox' bonus if the
target is a building
if ( psTempObj->type == OBJ_STRUCTURE ||
psTempObj->type == OBJ_FEATURE)
{
//Watermelon:ignore oil resource and pickup
if ( psTempObj->type == OBJ_FEATURE )
{
if ( ((FEATURE
*)psTempObj)->psStats->damageable == 0)
Why check this inside the OBJ_STRUCTURE part? Shouldn't it be an extra
part?
Also: Why don't check for psObj->damageable directly?
because both of them are 'Building',I need to set wpRadius to 1 for them,or
their bounding box will be enlarged to unrealistic level(the one kamaze
mentioned in forum)
damageable flag is only available for 'FEATURE' type,even the transport in
sp campaign uses a hack to prevent it from being destroyed...
{
continue;
}
}
wpRadius = 1;
Won't this break?
When a projectile flies next to a building it's radius is always reduced to
1
it seems to me...
no,it's just 'reset' the hit bounding box's radius bonus to 1(no bonus),the
comparison function:
if ((xdiff*xdiff + ydiff*ydiff) < (wpRadius *
(SDWORD)(establishTargetRadius(psTempObj)) *
(SDWORD)(establishTargetRadius(psTempObj))) )
{
//hit
}
//not hit
As you can see,the TargetRadiusSquared is multiplied by the 'wpRadius' when
comparing distSquared and TargetRadiusSquared,setting it to '1' wont break
anything as far as I know.The 'wpTargetRaidus' is to compensate the weapons'
inability of hitting moving target after the projectile 'hit' system
changes,now all projectiles have to actually collide with object to do
damage to it.
_________________________________________________________________
Don't just search. Find. Check out the new MSN Search!
http://search.msn.click-url.com/go/onm00200636ave/direct/01/
_______________________________________________
Warzone-dev mailing list
Warzone-dev@gna.org
https://mail.gna.org/listinfo/warzone-dev