Am Dienstag, 28. November 2006 20:41 schrieb zz zz: + //Watermelon:fix turret pitch for more turrets + if (((DROID *)psAttacker)->numWeaps > 0) + { + if (weapon_slot >= 0) + { + ((DROID *) psAttacker)->turretPitch[weapon_slot] = psObj->pitch; + } + } + else + { + ((DROID *) psAttacker)->turretPitch[0] = psObj->pitch; + }
Why can't just ((DROID *) psAttacker)->turretPitch[weapon_slot] = psObj->pitch; be used? Is weapon_slot not 0 if we got 0 numWeaps? And: Do we have negative wpn slots? Just curious: Why is following done? To save dereferencings of pointers? if (psStats->penetrate) { bPenetrate = TRUE; } Again curious: What does this do? (Is that the hitbox check?) + /* see if psCurrD is hit (don't hit main target twice) */ + if (((BASE_OBJECT *)psCurrD != psObj->psDest) && + ((SDWORD)psCurrD->x >= tarX0) && + ((SDWORD)psCurrD->x <= tarX1) && + ((SDWORD)psCurrD->y >= tarY0) && + ((SDWORD)psCurrD->y <= tarY1) && + ((SDWORD)psCurrD->z >= tarZ0) && + ((SDWORD)psCurrD->z <= tarZ1)) Everyone: Please fix all of the following, if you see it in the code: + DBP1(("Damage to object %d, player %d\n", + psCurrD->id, psCurrD->player)); This has to be some debug() call. Does this mean that you can hit friendly units now? + /* Do damage to everything in range */ + for (i=0; i<MAX_PLAYERS; i++) Again just curious: When I thought about an own engine (a long while ago) I had the idea to use "hitbubbles" instead of hitboxes, so I don't need to check whether something is between all sides of the box, but only need to compare the distance to the mid of the bubble with the radius. Why is this not a good approach, or: Why didn't you choose this approach? --Dennis
pgpf2FHHLdJSY.pgp
Description: PGP signature
_______________________________________________ Warzone-dev mailing list Warzone-dev@gna.org https://mail.gna.org/listinfo/warzone-dev