|
From: Rob <geo...@us...> - 2005-08-28 20:33:17
|
Update of /cvsroot/timewarp/source/sc3ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4947/source/sc3ships Modified Files: shpdakvi.cpp shpexqen.cpp shpktacr.cpp shpowavo.cpp shpplopl.cpp shpvyrin.cpp shpxchex.cpp Log Message: debugging Index: shpowavo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpowavo.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpowavo.cpp 2 Aug 2005 00:23:49 -0000 1.13 --- shpowavo.cpp 28 Aug 2005 20:33:07 -0000 1.14 *************** *** 298,301 **** --- 298,303 ---- void OwaDisable::calculate() { + SpaceObject::calculate(); + if (!(ship && ship->exists())) { *************** *** 311,326 **** } ! if (!lowerindex) { ! pos = target->normal_pos(); ! //((Ship*)target)->nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust); } ! else { ! pos = target->normal_pos(); } ! disableframe += frame_time; if (disableframe >= disableframe_count) state = 0; ! if (!target->exists()) { state = 0; --- 313,332 ---- } ! ! if (target) ! { ! if (!lowerindex) ! { ! pos = target->normal_pos(); ! //((Ship*)target)->nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust); } ! else { ! pos = target->normal_pos(); } ! } disableframe += frame_time; if (disableframe >= disableframe_count) state = 0; ! if (!target) { state = 0; *************** *** 333,338 **** } - // the following can set target=0, so must be done last - SpaceObject::calculate(); } --- 339,342 ---- Index: shpxchex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpxchex.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpxchex.cpp 2 Aug 2005 00:23:49 -0000 1.15 --- shpxchex.cpp 28 Aug 2005 20:33:07 -0000 1.16 *************** *** 146,154 **** void XchaggerDisable::calculate() { ! if (!(ship && ship->exists())) { state = 0; } frame_step+= frame_time; --- 146,163 ---- void XchaggerDisable::calculate() { + SpaceObject::calculate(); ! if (ship && !ship->exists()) { + ship = 0; state = 0; } + + if ( affectship && !affectship->exists() ) + { + // note that target == affectship, so that if target is reset to 0, the affectship is still a valid pointer. + affectship->del_override_control(ocx); + affectship = 0; + } frame_step+= frame_time; *************** *** 177,181 **** else { pos = t->normal_pos() + (frame_time * t->get_vel()); - SpaceObject::calculate(); } disableframe += frame_time; --- 186,189 ---- *************** *** 186,194 **** } - // THIS CHECK IS NEEDED BEFORE RETURNING ... if (!exists()) { ! // note that target == affectship, so that if target is reset to 0, the affectship is still a valid pointer. ! affectship->del_override_control(ocx); } } --- 194,201 ---- } if (!exists()) { ! if (affectship) ! affectship->del_override_control(ocx); } } *************** *** 223,228 **** Query a; int found = FALSE; ! for (a.begin(this, ALL_LAYERS ,distance(other)+ 10); ! a.current; a.next()) { o = a.currento; if ((o->getID()) == XCHAGGERDISABLE_SPEC) --- 230,238 ---- Query a; int found = FALSE; ! ! for (a.begin(this, ALL_LAYERS ,distance(other)+ 10, QUERY_OBJECT); ! a.currento; a.next()) ! { ! o = a.currento; if ((o->getID()) == XCHAGGERDISABLE_SPEC) Index: shpexqen.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpexqen.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpexqen.cpp 26 Aug 2005 21:55:20 -0000 1.12 --- shpexqen.cpp 28 Aug 2005 20:33:07 -0000 1.13 *************** *** 98,102 **** Query a; double multi = ((double)((random () % 20) + 10) / 10); ! for (a.begin(this, bit(LAYER_SHIPS), specialRange); a.current; a.next()) { o = a.currento; if( (!o->sameTeam(this)) && (distance(o) < specialRange) && --- 98,102 ---- Query a; double multi = ((double)((random () % 20) + 10) / 10); ! for (a.begin(this, bit(LAYER_SHIPS), specialRange, QUERY_OBJECT); a.current; a.next()) { o = a.currento; if( (!o->sameTeam(this)) && (distance(o) < specialRange) && *************** *** 187,191 **** Query a; for (a.begin(this,bit(LAYER_SHOTS) + bit(LAYER_SPECIAL), ! dist); a.current; a.next()) { o = a.currento; if( (!o->sameTeam(this)) && (distance(o) < oldrange) && --- 187,191 ---- Query a; for (a.begin(this,bit(LAYER_SHOTS) + bit(LAYER_SPECIAL), ! dist, QUERY_OBJECT); a.current; a.next()) { o = a.currento; if( (!o->sameTeam(this)) && (distance(o) < oldrange) && *************** *** 219,223 **** Query a; for (a.begin(this,bit(LAYER_SHOTS) + bit(LAYER_SPECIAL), ! safedist * 2.5); a.current; a.next()) { o = a.currento; if( (!o->sameTeam(this)) && (distance(o) < oldrange) && --- 219,223 ---- Query a; for (a.begin(this,bit(LAYER_SHOTS) + bit(LAYER_SPECIAL), ! safedist * 2.5, QUERY_OBJECT); a.current; a.next()) { o = a.currento; if( (!o->sameTeam(this)) && (distance(o) < oldrange) && Index: shpplopl.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpplopl.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpplopl.cpp 11 Jul 2005 00:25:59 -0000 1.7 --- shpplopl.cpp 28 Aug 2005 20:33:07 -0000 1.8 *************** *** 70,78 **** void PloxisPlunderer::calculate() { if(shieldFrames > 0) { recharge_amount = 0; shieldFrames-= frame_time; Query a; ! for (a.begin(this, bit(LAYER_SHOTS),250); a.current; a.next()) { SpaceObject *o = a.currento; if ((!o->sameShip(this)) && (o->isShot()) && ((distance(o) --- 70,80 ---- void PloxisPlunderer::calculate() { + Ship::calculate(); + if(shieldFrames > 0) { recharge_amount = 0; shieldFrames-= frame_time; Query a; ! for (a.begin(this, bit(LAYER_SHOTS),250, QUERY_OBJECT); a.current; a.next()) { SpaceObject *o = a.currento; if ((!o->sameShip(this)) && (o->isShot()) && ((distance(o) *************** *** 95,99 **** } else recharge_amount = 1; - Ship::calculate(); } --- 97,100 ---- Index: shpdakvi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpdakvi.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpdakvi.cpp 11 Jul 2005 00:25:59 -0000 1.8 --- shpdakvi.cpp 28 Aug 2005 20:33:06 -0000 1.9 *************** *** 125,128 **** --- 125,130 ---- void DaktaklakpakVivisector::calculate() { + Ship::calculate(); + if(drillFrames > 0) { drillFrames-= frame_time; *************** *** 162,166 **** numMines -= j; - Ship::calculate(); } int DaktaklakpakVivisector::canCollide(SpaceObject *other) --- 164,167 ---- *************** *** 241,245 **** double oldrange = 999999; Query a; ! for (a.begin(this, bit(LAYER_SHIPS),(missileRange *.9)); a.current; a.next()) { o = a.currento; --- 242,246 ---- double oldrange = 999999; Query a; ! for (a.begin(this, bit(LAYER_SHIPS),(missileRange *.9), QUERY_OBJECT); a.current; a.next()) { o = a.currento; Index: shpktacr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpktacr.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpktacr.cpp 11 Jul 2005 00:25:59 -0000 1.7 --- shpktacr.cpp 28 Aug 2005 20:33:07 -0000 1.8 *************** *** 119,122 **** --- 119,124 ---- void KtangCrippler::calculate() { + Ship::calculate(); + int j = 0; for (int i = 0; i < numMines; i += 1) { *************** *** 126,130 **** } numMines -= j; - Ship::calculate(); } --- 128,131 ---- *************** *** 160,164 **** double oldrange = 999999; Query a; ! for (a.begin(this, bit(LAYER_SHIPS),(missileRange *.9)); a.current; a.next()) { o = a.currento; --- 161,165 ---- double oldrange = 999999; Query a; ! for (a.begin(this, bit(LAYER_SHIPS),(missileRange *.9), QUERY_OBJECT); a.current; a.next()) { o = a.currento; Index: shpvyrin.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpvyrin.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpvyrin.cpp 2 Aug 2005 00:23:49 -0000 1.12 --- shpvyrin.cpp 28 Aug 2005 20:33:07 -0000 1.13 *************** *** 138,141 **** --- 138,143 ---- { + Ship::calculate(); + if (sheild) if (sheild->exists()) { *************** *** 143,147 **** sheild->state = 0; } else sheild = NULL; - Ship::calculate(); } --- 145,148 ---- *************** *** 165,168 **** --- 166,171 ---- void VyroIngoSheild::calculate() { + SpaceObject::calculate(); + if(!(ship && ship->exists())) { *************** *** 182,186 **** pos = ship->normal_pos(); vel = ship->get_vel(); - SpaceObject::calculate(); } --- 185,188 ---- |