You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(136) |
Dec
(218) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(214) |
Feb
(208) |
Mar
(186) |
Apr
(15) |
May
(3) |
Jun
(35) |
Jul
(6) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2005 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(58) |
Aug
(123) |
Sep
(31) |
Oct
(9) |
Nov
|
Dec
(1) |
2006 |
Jan
(25) |
Feb
(10) |
Mar
(25) |
Apr
(61) |
May
|
Jun
(78) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2007 |
Jan
|
Feb
|
Mar
|
Apr
(12) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(10) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2014 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Rob <geo...@us...> - 2005-08-01 10:46:51
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/sc2ships Modified Files: shppkufu.cpp shpzfpst.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: shppkufu.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shppkufu.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shppkufu.cpp 24 Mar 2004 23:51:44 -0000 1.13 --- shppkufu.cpp 1 Aug 2005 10:46:34 -0000 1.14 *************** *** 35,40 **** game->add(new Animation(this, pos, meleedata.kaboomSprite, 0, KABOOM_FRAMES, time_ratio, DEPTH_EXPLOSIONS)); ! if (random() % 2) { if (attributes & ATTRIB_NOTIFY_ON_DEATH){ game->ship_died(this, source); --- 35,41 ---- game->add(new Animation(this, pos, meleedata.kaboomSprite, 0, KABOOM_FRAMES, time_ratio, DEPTH_EXPLOSIONS)); + ! if ( (random() & 1) == 0) { if (attributes & ATTRIB_NOTIFY_ON_DEATH){ game->ship_died(this, source); Index: shpzfpst.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpzfpst.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpzfpst.cpp 11 Jul 2005 00:25:59 -0000 1.12 --- shpzfpst.cpp 1 Aug 2005 10:46:35 -0000 1.13 *************** *** 110,113 **** --- 110,115 ---- isblockingweapons = true; debug_id = 1049; + + attributes &= ~ATTRIB_STANDARD_INDEX; } |
From: Rob <geo...@us...> - 2005-08-01 10:46:51
|
Update of /cvsroot/timewarp/source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source Modified Files: scp.cpp scp.h Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: scp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/scp.cpp,v retrieving revision 1.73 retrieving revision 1.74 diff -C2 -d -r1.73 -r1.74 *** scp.cpp 11 Jul 2005 00:25:10 -0000 1.73 --- scp.cpp 1 Aug 2005 10:46:35 -0000 1.74 *************** *** 532,537 **** } ! bool is_local (int channel) { ! return (glog->get_direction (channel) & Log::direction_write); } --- 532,549 ---- } ! bool log_empty(int channel) ! { ! if (glog->log_pos[channel] == glog->log_len[channel]) ! return true; ! else ! return false; ! } ! ! bool is_local (int channel) ! { ! if (is_bot(channel)) ! return true; ! else ! return (glog->get_direction (channel) & Log::direction_write); } Index: scp.h =================================================================== RCS file: /cvsroot/timewarp/source/scp.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** scp.h 11 Jul 2005 00:25:11 -0000 1.11 --- scp.h 1 Aug 2005 10:46:35 -0000 1.12 *************** *** 27,34 **** --- 27,38 ---- bool is_bot (int channel); void log_file (const char *fname); + bool log_empty(int channel = channel_current); void test_net(); + extern bool optimize4latency; + + extern SAMPLE * menuAccept; extern SAMPLE * menuFocus; |
From: Rob <geo...@us...> - 2005-08-01 10:46:48
|
Update of /cvsroot/timewarp/source/other In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/other Modified Files: objanim.cpp objanim.h shippart.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: shippart.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/shippart.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shippart.cpp 24 Mar 2004 23:51:43 -0000 1.11 --- shippart.cpp 1 Aug 2005 10:46:34 -0000 1.12 *************** *** 24,27 **** --- 24,28 ---- collide_flag_sameship = 0; collide_flag_sameteam = 0; + attributes |= ATTRIB_UNDETECTABLE; } *************** *** 141,144 **** --- 142,147 ---- targets->add(this); + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: objanim.cpp =================================================================== RCS file: /cvsroot/timewarp/source/other/objanim.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** objanim.cpp 24 Mar 2004 23:51:43 -0000 1.8 --- objanim.cpp 1 Aug 2005 10:46:34 -0000 1.9 *************** *** 11,28 **** angle(oangle) { ! vel = ovel; ! sprite_index = get_index(angle); ! sprite_index += first_frame * 64; } ! void ObjectAnimation::calculate(){ ! STACKTRACE ! sprite_index >>= 6; ! Animation::calculate(); ! sprite_index <<= 6; ! int i = get_index(angle); ! sprite_index += i; } --- 11,61 ---- angle(oangle) { ! vel = ovel; ! ! sprite_index = get_index(angle); ! sprite_index += first_frame * 64; ! //attributes &= ~ATTRIB_STANDARD_INDEX; ! remember_num_frames = num_frames; } ! void ObjectAnimation::calculate() ! { ! STACKTRACE; ! ! // divide by 64 (yields the animation frame) ! sprite_index >>= 6; ! // the animation increases the frame index to the next frame ! Animation::calculate(); ! ! ! // note that an animation "dies" if the last frame is reached. In that case, you don't need to ! // check for errors anymore. ! if (exists()) ! { ! ! int k = sprite_index; ! if (k >= remember_num_frames || k < 0) ! { ! tw_error("Object Animation error in animation frame !! Should have died."); ! } ! ! // this is the same as multiplying by 64 ! sprite_index <<= 6; ! ! // this adds the angle ! int i = get_index(angle); ! sprite_index += i; ! ! // note, that you've got 1 set of animations for 1 angle, and there are 64 angles. ! ! if (sprite_index >= sprite->frames()) ! { ! tw_error("SpaceSprite::animate - index %d in %s >= count %d", sprite_index, get_identity(), sprite->frames()); ! return; ! } ! ! } } Index: objanim.h =================================================================== RCS file: /cvsroot/timewarp/source/other/objanim.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** objanim.h 24 Mar 2004 23:51:43 -0000 1.7 --- objanim.h 1 Aug 2005 10:46:34 -0000 1.8 *************** *** 10,13 **** --- 10,14 ---- double angle; + int remember_num_frames; public: |
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/melee Modified Files: manim.cpp mcbodies.cpp mframe.cpp mgame.h mnet1.cpp moptions.cpp mship.cpp mshot.cpp mview.cpp mview.h Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: mcbodies.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mcbodies.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** mcbodies.cpp 11 Jul 2005 00:25:13 -0000 1.14 --- mcbodies.cpp 1 Aug 2005 10:46:33 -0000 1.15 *************** *** 31,43 **** armour = 0.99;//*tau* } void Asteroid::calculate() ! {STACKTRACE step-= frame_time; while(step <= 0) { step += speed * time_ratio; sprite_index++; ! if(sprite_index == ASTEROID_FRAMES) sprite_index = 0; } --- 31,48 ---- armour = 0.99;//*tau* + + sprite_index = random(sprite->frames()); + attributes &= ~ATTRIB_STANDARD_INDEX; } void Asteroid::calculate() ! { ! STACKTRACE; ! step-= frame_time; while(step <= 0) { step += speed * time_ratio; sprite_index++; ! if(sprite_index == sprite->frames()) sprite_index = 0; } Index: mgame.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.h,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** mgame.h 11 Jul 2005 00:25:28 -0000 1.20 --- mgame.h 1 Aug 2005 10:46:33 -0000 1.21 *************** *** 8,12 **** #include "mfleet.h" - extern int random_seed[2]; extern int interpolate_frames; --- 8,11 ---- *************** *** 101,104 **** --- 100,105 ---- bool desynch_received; + int crc; + bool islocal(); bool ishost(); *************** *** 319,322 **** --- 320,324 ---- double next_tic_time; double msecs_per_render; + double msecs_per_render_max; double next_render_time; Histograph *tic_history; *************** *** 345,348 **** --- 347,351 ---- void test_event1(int iplayer); void start_iteration(int iplayer); + void share_crc(int iplayer); void disconnect(int iplayer); *************** *** 375,378 **** --- 378,382 ---- void network_share_keys(); + void network_crc_check(); void test_startit(); // just for testing. Index: mnet1.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mnet1.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** mnet1.cpp 11 Jul 2005 00:25:28 -0000 1.16 --- mnet1.cpp 1 Aug 2005 10:46:33 -0000 1.17 *************** *** 637,641 **** return false; ! idle(1); } --- 637,641 ---- return false; ! idle(10); } Index: mview.h =================================================================== RCS file: /cvsroot/timewarp/source/melee/mview.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** mview.h 11 Jul 2005 00:25:29 -0000 1.10 --- mview.h 1 Aug 2005 10:46:34 -0000 1.11 *************** *** 8,11 **** --- 8,12 ---- //global flags: read/write extern int camera_hides_cloakers; + extern int show_red_cloaker; extern int FULL_REDRAW; Index: mshot.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mshot.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** mshot.cpp 11 Jul 2005 00:25:28 -0000 1.17 --- mshot.cpp 1 Aug 2005 10:46:33 -0000 1.18 *************** *** 160,163 **** --- 160,164 ---- frame_step(ofsize) { + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: manim.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/manim.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** manim.cpp 11 Jul 2005 00:25:13 -0000 1.11 --- manim.cpp 1 Aug 2005 10:46:33 -0000 1.12 *************** *** 43,46 **** --- 43,48 ---- // from the query list: attributes |= ATTRIB_UNDETECTABLE; + + attributes &= ~ATTRIB_STANDARD_INDEX; } *************** *** 68,72 **** } ! else sprite->animate(pos, sprite_index, space, scale); } --- 70,86 ---- } ! else ! { ! if (sprite) ! { ! if (sprite_index >= sprite->frames()) ! { ! tw_error("SpaceSprite::animate - index %d in %s >= count %d", sprite_index, get_identity(), sprite->frames()); ! return; ! } ! ! sprite->animate(pos, sprite_index, space, scale); ! } ! } } Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** mship.cpp 21 Jul 2005 14:55:07 -0000 1.36 --- mship.cpp 1 Aug 2005 10:46:33 -0000 1.37 *************** *** 958,963 **** special_low = FALSE; ! if(fire_special) { ! if(batt < special_drain) { special_low = TRUE; return; --- 958,964 ---- special_low = FALSE; ! if(fire_special) ! { ! if (batt < special_drain) { special_low = TRUE; return; *************** *** 967,971 **** return; ! if(!activate_special()) return; --- 968,972 ---- return; ! if(activate_special() == 0) return; Index: mview.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mview.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** mview.cpp 11 Jul 2005 00:25:29 -0000 1.21 --- mview.cpp 1 Aug 2005 10:46:34 -0000 1.22 *************** *** 23,26 **** --- 23,27 ---- int FULL_REDRAW = 0; int camera_hides_cloakers = 0; + int show_red_cloaker = 1; Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** mframe.cpp 21 Jul 2005 14:55:06 -0000 1.33 --- mframe.cpp 1 Aug 2005 10:46:33 -0000 1.34 *************** *** 668,679 **** if (sprite) { ! if (attributes & ATTRIB_STANDARD_INDEX) { ! sprite_index = get_index(angle, PI/2, sprite->frames()); } ! // error check: ! if (sprite_index >= sprite->frames() || sprite_index < 0) { tw_error("sprite index overflow in %s", get_identity()); } --- 668,682 ---- if (sprite) { ! if ( (attributes & ATTRIB_STANDARD_INDEX) != 0) { ! calculate_index(); ! //sprite_index = get_index(angle, PI/2, sprite->frames()); //xxx ERROR !! } ! // error check: ! if ( (sprite_index >= sprite->frames()) || (sprite_index < 0) ) { + int N = sprite->frames(); + double a = angle; tw_error("sprite index overflow in %s", get_identity()); } *************** *** 685,689 **** void SpaceObject::calculate_index() { ! if (sprite->frames() > 64) sprite_index = get_index(angle); else --- 688,692 ---- void SpaceObject::calculate_index() { ! if (sprite->frames() >= 64) sprite_index = get_index(angle); else *************** *** 708,712 **** --- 711,719 ---- isblockingweapons = true; // ext_ai = NULL; + + // I think this should be turned on by default... + attributes |= ATTRIB_STANDARD_INDEX; } + SpaceObject::~SpaceObject() { Index: moptions.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/moptions.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** moptions.cpp 11 Jul 2005 00:25:28 -0000 1.17 --- moptions.cpp 1 Aug 2005 10:46:33 -0000 1.18 *************** *** 424,427 **** --- 424,428 ---- OPTIONS_DIALOG_FRIENDLY_FIRE, OPTIONS_DIALOG_HIDE_CLOAKERS, + OPTIONS_DIALOG_SHOW_RED_CLOAKER, OPTIONS_DIALOG_3DPLANET, OPTIONS_DIALOG_SYNCLAG, *************** *** 463,467 **** { d_check_proc, 40, 140, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Friendly Fire", NULL, NULL }, //OPTIONS_DIALOG_FRIENDLY_FIRE, { d_check_proc, 40, 155, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Camera hides cloakers", NULL, NULL }, //OPTIONS_DIALOG_HIDE_CLOAKERS, ! { d_check_proc, 40, 170, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"3D Planet", NULL, NULL }, //OPTIONS_DIALOG_3DPLANET, { d_check_proc, 200, 140, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Synched-lag", NULL, NULL }, //OPTIONS_DIALOG_SYNCLAG, { d_check_proc, 200, 155, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Desynch-test", NULL, NULL }, //OPTIONS_DIALOG_DESYNCTEST, --- 464,469 ---- { d_check_proc, 40, 140, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Friendly Fire", NULL, NULL }, //OPTIONS_DIALOG_FRIENDLY_FIRE, { d_check_proc, 40, 155, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Camera hides cloakers", NULL, NULL }, //OPTIONS_DIALOG_HIDE_CLOAKERS, ! { d_check_proc, 40, 170, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Show red cloakers", NULL, NULL }, //OPTIONS_DIALOG_SHOW_RED_CLOAKER, ! { d_check_proc, 40, 185, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"3D Planet", NULL, NULL }, //OPTIONS_DIALOG_3DPLANET, { d_check_proc, 200, 140, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Synched-lag", NULL, NULL }, //OPTIONS_DIALOG_SYNCLAG, { d_check_proc, 200, 155, 100, 14, 255, 0, 0, 0, 1, 0, (void*)"Desynch-test", NULL, NULL }, //OPTIONS_DIALOG_DESYNCTEST, *************** *** 518,521 **** --- 520,528 ---- old_optionsDialog[OPTIONS_DIALOG_HIDE_CLOAKERS].flags = 0; + if (get_config_int("View", "ShowRedCloaker", 1)) + old_optionsDialog[OPTIONS_DIALOG_SHOW_RED_CLOAKER].flags = D_SELECTED; + else + old_optionsDialog[OPTIONS_DIALOG_SHOW_RED_CLOAKER].flags = 0; + if (get_config_int("Planet", "PlanetDimension", 2) == 3) old_optionsDialog[OPTIONS_DIALOG_3DPLANET].flags = D_SELECTED; *************** *** 601,605 **** i = 1; else i = 0; ! twconfig_set_int("/cfg/server.ini/view/camerahidescloakers", i); if (old_optionsDialog[OPTIONS_DIALOG_SYNCLAG].flags & D_SELECTED) --- 608,618 ---- i = 1; else i = 0; ! twconfig_set_int("/cfg/server.ini/view/CameraHidesCloakers", i); ! ! if (old_optionsDialog[OPTIONS_DIALOG_SHOW_RED_CLOAKER].flags & D_SELECTED) ! i = 1; ! else i = 0; ! twconfig_set_int("/cfg/server.ini/view/ShowRedCloaker", i); ! if (old_optionsDialog[OPTIONS_DIALOG_SYNCLAG].flags & D_SELECTED) |
From: Rob <geo...@us...> - 2005-08-01 10:46:48
|
Update of /cvsroot/timewarp/source/sc1ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27867/source/sc1ships Modified Files: shpilwav.cpp shpmycpo.cpp Log Message: miscellaneous fixes (mainly with sprite-index overflow handling/ fixing) Index: shpmycpo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpmycpo.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpmycpo.cpp 11 Jul 2005 00:25:58 -0000 1.10 --- shpmycpo.cpp 1 Aug 2005 10:46:34 -0000 1.11 *************** *** 67,70 **** --- 67,72 ---- collide_flag_sameteam |= bit(LAYER_SHIPS); debug_id = 1015; + + attributes &= ~ATTRIB_STANDARD_INDEX; } Index: shpilwav.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc1ships/shpilwav.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** shpilwav.cpp 11 Jul 2005 00:25:58 -0000 1.9 --- shpilwav.cpp 1 Aug 2005 10:46:34 -0000 1.10 *************** *** 92,100 **** { if((cloak_frame > 0) && (cloak_frame < 300)) sprite->animate_character( pos, sprite_index, pallete_color[cloak_color[cloak_frame / 100]], space); else if ((cloak_frame >= 300)) { ! if (is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[255], space); else --- 92,102 ---- { if((cloak_frame > 0) && (cloak_frame < 300)) + { sprite->animate_character( pos, sprite_index, pallete_color[cloak_color[cloak_frame / 100]], space); + } else if ((cloak_frame >= 300)) { ! if (!show_red_cloaker || is_bot(control->channel) || !is_local(control->channel) || (!game_networked && num_network>1)) // bots and remote players are "hidden" sprite->animate_character( pos, sprite_index, pallete_color[255], space); else |
From: Rob <geo...@us...> - 2005-08-01 10:45:33
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27660/source/melee Modified Files: mgame.cpp Log Message: main game loop improved (timing) ; event handling fixed Index: mgame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mgame.cpp,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** mgame.cpp 11 Jul 2005 00:25:28 -0000 1.47 --- mgame.cpp 1 Aug 2005 10:45:24 -0000 1.48 *************** *** 96,99 **** --- 96,100 ---- desynch_Nitems = 0; desynch_received = false; + crc = 0; } *************** *** 204,209 **** static int chat_on = 0; - int random_seed[2]; - MeleeData meleedata; --- 205,208 ---- *************** *** 1067,1070 **** --- 1066,1093 ---- + + void Game::network_crc_check() + { + // share (and test) desynch information + int p; + for ( p = 0 ; p < num_network; ++p ) + { + // sharing + if (player[p] && player[p]->islocal()) + { + CALL(share_crc, p); + } + + // checking the results of a previous share. + if (p > 0) + { + if (player[p]->crc != player[p-1]->crc) + { + tw_error("The game is desynched."); + } + } + } + } + void Game::init_lag() { *************** *** 1141,1146 **** lag_buffer = 1; // well, you do need to start... ! if (lag_buffer > 100) ! lag_buffer = 100; message.print(1500, 15, "lag set to [%i] frames", lag_buffer); --- 1164,1169 ---- lag_buffer = 1; // well, you do need to start... ! if (lag_buffer > 10) ! lag_buffer = 10; message.print(1500, 15, "lag set to [%i] frames", lag_buffer); *************** *** 1260,1263 **** --- 1283,1287 ---- init_lag(); + int i; for ( i = 0; i < lag_buffer; ++i ) *************** *** 1280,1283 **** --- 1304,1309 ---- lag_decrease = 0; + int time_start = get_time(); + try { *************** *** 1285,1289 **** { ! unsigned int time = get_time(); poll_input(); videosystem.poll_redraw(); --- 1311,1319 ---- { ! unsigned int time; ! ! time = get_time(); ! // this is used to time animation and physics ! poll_input(); videosystem.poll_redraw(); *************** *** 1292,1302 **** } // note, you go to the next calculation either because some required time has // passed, or because you need to catch up with some kind of lag... ! if ((next_tic_time <= time) && (next_render_time > game_time)) /*&& ! (game_ready() || game_time == 0)*/ { // note that game_time==0 is also needed, cause otherwise it'll wait for data, while no data've been generated yet. _STACKTRACE("Game::play - Game physics"); --- 1322,1343 ---- } + // physics can catch up with graphics. + bool catching_up; + catching_up = false; + + // check if something interesting happens in this iteration (false), otherwise (true) + // issue an idle time. + bool idle_iteration = true; + + // note, you go to the next calculation either because some required time has // passed, or because you need to catch up with some kind of lag... ! if ((next_tic_time <= time))//geo:physics should be independent of animation && (next_render_time > game_time)) && ! /*(game_ready() || game_time == 0)*/ { // note that game_time==0 is also needed, cause otherwise it'll wait for data, while no data've been generated yet. _STACKTRACE("Game::play - Game physics"); + //idle_iteration = false; + *************** *** 1311,1337 **** // also see the CALL and EVENT macros ! if (events.all_ready()) ! { ! // only reset the call-state, if previously, all calls have been handled. ! events.set_wait(); ! } ! int t = get_time(); ! for (;;) ! { ! NetLog *l = (NetLog*) glog; ! if (l->type == Log::log_net) ! { ! l->flush_noblock(); ! //glog->listen(); ! l->recv_noblock(); // receive stuff, if you can ! } ! events.handle(); // this will read events. You send events during the game. ! ! if (events.all_ready()) ! break; ! ! } --- 1352,1394 ---- // also see the CALL and EVENT macros ! if (events.all_ready()) ! { ! // only reset the call-state, if previously, all calls have been handled. ! events.set_wait(); ! } ! ! ! int t = get_time(); ! // for (;;) ! // { ! NetLog *l = (NetLog*) glog; ! if (l->type == Log::log_net) ! { ! l->flush_noblock(); ! //glog->listen(); ! l->recv_noblock(); // receive stuff, if you can + } + events.handle(); // this will read events. You send events during the game. + // if all "start-iterations" are set, then they're all_ready. + + // Note, that the IF statement ensures, that you do not block the game by waiting + // for (networked) input. This means, that graphics won't be blocked: otherwise, + // graphics of this user can be delayed by graphics of another user, resulting in + // a pretty slow framerate. + + if (!events.all_ready()) + { + //message.print(1000, 15, "events not ready"); + //xxx this happens, if you press a key !! + } + + if (events.all_ready()) + { + idle_iteration = false; ! // a short resting period. ! // idle(1); ! // } *************** *** 1366,1496 **** return; } ! // } ! // note that, to reduce lag, you keep reading data from the buffer without ! // adding extra stuff (through CALL), so that it becomes smaller. ! // BUT: that skips keys, and this leads to a desynch SO THIS IS NOT A GOOD WAY TO DO IT !! ! ! ! // then calculate game stuff ! calculate(); ! ! ! // this can also do some game stuff ... (namely, Esc = quit) ! while (keypressed()) ! handle_key(readkey()); ! ! // check if the network is in synch? ! ! // enable this if you want to check for desynches ! if (do_desynch_test) ! { ! // send desynch data for local player(s) ! int p; ! for ( p = 0 ; p < num_network; ++p ) { ! if (player[p] && player[p]->islocal()) { ! CALL(event_share_desynch, p); } } ! // check desynch data of the players in the current (lagged) frame. ! check_desynch(); ! } ! ! // it's best to do this only in debug mode... ! ! // actually ... duh ... it's best to call this AFTER the events-handle, cause then the data ! // have some time to be sent across the network, while the game is doing its calculations. ! // namely, then it's using the idle() time that's required or so... ! network_share_keys(); ! ! // approve of the next iteration, after ALL possible event thingies are done. ! if (lag_decrease == 0) ! { ! int p; ! for ( p = 0 ; p < num_network; ++p ) { ! if (player[p] && player[p]->islocal()) { ! CALL(start_iteration, p); } } ! } else { ! --lag_decrease; // skip new-iteration calls. ! --lag_buffer; ! } ! // and increasing lag means, adding extra, empty, iterations... ! int ilag; ! for ( ilag = 0; ilag < lag_increase; ++ilag ) ! { ! int p; ! for ( p = 0 ; p < num_network; ++p ) { ! if (player[p] && player[p]->islocal()) { ! CALL(start_iteration, p); } } ! ++lag_buffer; ! --lag_increase; } ! if (auto_unload) unload_unused_ship_data(); - //if (key[KEY_F4]) - // turbo = f4_turbo; - //else - // turbo = normal_turbo; ! next_tic_time += (frame_time / turbo); ! if ((hiccup_margin >= 0) && (next_tic_time + hiccup_margin < get_time())) ! next_tic_time = get_time(); ! if (next_fps_time <= game_time) ! { ! next_fps_time += msecs_per_fps; ! fps(); ! } ! // in any case, already send the data that were calculated (don't waste time on this..). ! if (glog->type == Log::log_net) { ! // this sends, if there's something to send at least ! NetLog *l = (NetLog*) glog; ! l->flush_noblock(); ! } - // message.print(10, 15, "Idle time = %i", tot_idle_time / frame_number); - // message.animate(0); - } - else if (interpolate_frames || (game_time > next_render_time - msecs_per_render)) { - _STACKTRACE("Game::play - Game rendering") ! //message.print(1500, 15, "lag-buffer = %i", lag_buffer); ! animate(); ! next_render_time = game_time + msecs_per_render; } ! else { int n = 1; idle(n); tot_idle_time += n; - if (glog->type == Log::log_net) - { - NetLog *l = (NetLog*) glog; - l->recv_noblock(); // receive stuff, if you can - - // this helps to reduce idle-time, cause it doesn't have to wait till - // data are received first (namely that's what game_ready() tests). - l->flush_noblock(); // this sends, if there's something to send at least - } } } } --- 1423,1646 ---- return; } ! // } ! // note that, to reduce lag, you keep reading data from the buffer without ! // adding extra stuff (through CALL), so that it becomes smaller. ! // BUT: that skips keys, and this leads to a desynch SO THIS IS NOT A GOOD WAY TO DO IT !! ! ! ! int t_execute = get_time(); ! ! // calculate game stuff ! // this increases game_time. ! calculate(); ! ! // this measures how much time it takes to execute one physics iteration ! t_execute = get_time() - t_execute; ! ! ! // this can also do some game stuff ... (namely, Esc = quit) ! while (keypressed()) ! handle_key(readkey()); ! ! // check if the network is in synch? ! ! // enable this if you want to check for desynches ! // but, it only makes sense (in current implementation), if the two games are synched. ! if (global_lag_synch && do_desynch_test) { ! // send desynch data for local player(s) ! int p; ! for ( p = 0 ; p < num_network; ++p ) { ! if (player[p] && player[p]->islocal()) ! { ! CALL(event_share_desynch, p); ! } } + + // check desynch data of the players in the current (lagged) frame. + check_desynch(); } + + // it's best to do this only in debug mode... + + // actually ... duh ... it's best to call this AFTER the events-handle, cause then the data + // have some time to be sent across the network, while the game is doing its calculations. + // namely, then it's using the idle() time that's required or so... + + + network_share_keys(); + ! // crc checking is now only available, if all the games involved run synchronized, ! if (global_lag_synch) ! network_crc_check(); ! // approve of the next iteration, after ALL possible event thingies are done. ! if (lag_decrease == 0) { ! int p; ! for ( p = 0 ; p < num_network; ++p ) { ! if (player[p] && player[p]->islocal()) ! { ! CALL(start_iteration, p); ! } } + } else { + --lag_decrease; // skip new-iteration calls. + --lag_buffer; } ! ! // and increasing lag means, adding extra, empty, iterations... ! int ilag; ! for ( ilag = 0; ilag < lag_increase; ++ilag ) ! { ! int p; ! for ( p = 0 ; p < num_network; ++p ) ! { ! if (player[p] && player[p]->islocal()) ! { ! CALL(start_iteration, p); ! } ! } ! ++lag_buffer; ! --lag_increase; ! } ! ! if (auto_unload) ! unload_unused_ship_data(); ! ! ! ! ! //if (key[KEY_F4]) ! // turbo = f4_turbo; ! //else ! // turbo = normal_turbo; ! // ------------ GAME TIME MANAGEMENT ------------ ! ! // this hiccup-margin allows physics to "catch up" a few iterations that are ! // skipped by graphics. ! int time_current = get_time(); ! ! ! if (t_execute < 0.5*(frame_time / turbo)) { ! // in this case, you can try to have physics in a linear fashion ! ! if ((hiccup_margin >= 0) && (next_tic_time + hiccup_margin > /* < */ time_current)) { ! // trying to execute frames in a linear fashion. ! next_tic_time += (frame_time / turbo); ! ! if (next_tic_time < time_current) ! { ! //message.print(1500, 15, "Catching up"); ! catching_up = true; ! } else { ! catching_up = false; ! } ! ! } else { ! catching_up = false; ! next_tic_time = time_current; // execute as often as possible. } + } else { + // otherwise, the game calculations take so long, that trying to catch up + // is nigh impossible. + catching_up = false; + next_tic_time = time_current; // execute as often as possible. } ! ! if (next_fps_time <= game_time) ! { ! next_fps_time += msecs_per_fps; ! fps(); ! } ! /* ! // in any case, already send the data that were calculated (don't waste time on this..). ! // if you don't have to be careful about your connection speed. ! //if (!optimize4latency) ! //{ ! if (glog->type == Log::log_net) ! { ! // this sends, if there's something to send at least ! NetLog *l = (NetLog*) glog; ! l->flush_noblock(); ! } ! //} ! */ ! ! ! } + ! } ! ! // ALWAYS send/recv at end. ! // this is the best place for this, in FRONT of the animation, cause ! // it's best to send data BEFORE an animation starts... ! ! // if you don't have to be careful about your connection speed. ! if (glog->type == Log::log_net) ! { ! NetLog *l = (NetLog*) glog; ! l->recv_noblock(); // receive stuff, if you can ! // this helps to reduce idle-time, cause it doesn't have to wait till ! // data are received first (namely that's what game_ready() tests). ! l->flush_noblock(); // this sends, if there's something to send at least ! } ! ! ! // geo: instead of game_time, I use time, so that physics and animation are competely ! // independent; then, if physics has to wait for networked data, animation can continue ! // regardless of that. ! // well... except if physics tries to catch up a few frames of time. But in that case, ! // in networked games, it can take a while to synch back again; ! // so there must be an upper limit to the animation frame rate !! ! time = get_time(); ! if (!catching_up || time >= next_render_time - msecs_per_render + msecs_per_render_max) ! { ! if (interpolate_frames || (/*game_*/time >= next_render_time)) { ! _STACKTRACE("Game::play - Game rendering") ! ! idle_iteration = false; + // message.print(1000, 15, "anim dt = %i render = %i t = %i", + // int(time - next_render_time), int(msecs_per_render), int(time - time_start)); + //message.print(1500, 15, "lag-buffer = %i", lag_buffer); + animate(); ! if (time - next_render_time < msecs_per_render ) ! next_render_time += msecs_per_render; ! else ! next_render_time = /*game_*/time + msecs_per_render; ! } } ! ! ! if (idle_iteration) { + // if nothing interesting happend in this iteration, then insert some idle time int n = 1; idle(n); tot_idle_time += n; } + + + + } } *************** *** 1728,1745 **** rand_resync(); ! /* channel_current = channel_server; - i = rand(); - // i = 9223; - log_int(i); - random_seed[0] = i; - rng.seed(i); - i = rand(); - // i = 7386; - log_int(i); - random_seed[1] = i; - rng.seed_more(i); - */ if (!is_paused()) pause(); --- 1878,1884 ---- rand_resync(); ! channel_current = channel_server; if (!is_paused()) pause(); *************** *** 1750,1754 **** set_config_file("client.ini"); msecs_per_fps = get_config_int("View", "FPS_Time", 200); ! msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); prediction = get_config_int("Network", "Prediction", 50); if ((prediction < 0) || (prediction > 100)) {tw_error ("Prediction out of bounds (0 < %d < 100)", prediction);} --- 1889,1901 ---- set_config_file("client.ini"); msecs_per_fps = get_config_int("View", "FPS_Time", 200); ! ! //msecs_per_render = (int)(1000. / get_config_float("View", "MinimumFrameRate", 10) + 0.5); ! // instead such a weird equation, it's simply defined in terms of milliseconds. ! msecs_per_render = int( get_config_float("View", "MinimumFrameRate", 10) + 0.5 ); ! ! msecs_per_render_max = 100; ! if (msecs_per_render > msecs_per_render_max) ! msecs_per_render = msecs_per_render_max; ! prediction = get_config_int("Network", "Prediction", 50); if ((prediction < 0) || (prediction > 100)) {tw_error ("Prediction out of bounds (0 < %d < 100)", prediction);} *************** *** 1765,1768 **** --- 1912,1918 ---- share(-1, &camera_hides_cloakers); + show_red_cloaker = get_config_int("View", "ShowRedCloaker", 1); + share(-1, &show_red_cloaker); + time_ratio = (int)(1000. / get_config_float ("Game", "SC2FrameRate", 20)); share(-1, &time_ratio); *************** *** 2295,2323 **** int p; ! for ( p = 0; p < num_network; ++p ) { - if (!player[p]) - continue; - - if (!need_more[p]) - continue; ! // note, you can send+receive on your own channel, cause it's already buffered; the ! // receive reads from the start, and the send adds to the end of the log buffer. ! ! channel_current = player[p]->channel + _channel_buffered; ! event_player_current = p; // can also be useful. ! ! log_resetmode(); // go to default mode. ! log_nextmode(); // go to write mode ! log_nextmode(); // and skip, go to read mode. ! // executes a call to the function in the list, with that id-number ! int req; ! log_int(req); ! // player index is not stored: it's assumed that each player has its own channel ! issue(req, p); } --- 2445,2485 ---- int p; + bool data_left = true; ! while ( data_left ) { ! // keeps track if all of the available data for this iteration are read ! data_left = false; // assume all is read ! for ( p = 0; p < num_network; ++p ) ! { ! if (!player[p]) ! continue; ! ! if (!need_more[p]) ! continue; ! ! // note, you can send+receive on your own channel, cause it's already buffered; the ! // receive reads from the start, and the send adds to the end of the log buffer. ! ! channel_current = player[p]->channel + _channel_buffered; ! event_player_current = p; // can also be useful. ! ! log_resetmode(); // go to default mode. ! ! log_nextmode(); // go to write mode ! log_nextmode(); // and skip, go to read mode. ! ! // executes a call to the function in the list, with that id-number ! int req; ! log_int(req); ! // player index is not stored: it's assumed that each player has its own channel ! issue(req, p); ! if (!log_empty() && need_more[p]) ! data_left = true; ! ! } } *************** *** 2350,2353 **** --- 2512,2516 ---- EVENT(Game, event_lag_decrease); EVENT(Game, event_share_desynch); + EVENT(Game, share_crc); } *************** *** 2368,2371 **** --- 2531,2569 ---- + void Game::share_crc(int iplayer) + { + int crcvalue; + + if (log_synched) + { + // in receiving mode. + log_int(crcvalue); + + // store it for later use (for when all the players are updated) + player[iplayer]->crc = crcvalue; + + } else { + // in sending mode + // you've to define the data before sharing it with others + + int i, sumpos, sumvel; + + sumpos = 0; + sumvel = 0; + + for ( i = 0; i < num_items; ++i ) + { + SpaceLocation *o = item[i]; + sumpos += iround(o->pos.x + o->pos.y); + sumvel += iround(o->vel.x + o->vel.y); + } + + crcvalue = sumpos + sumvel; + + log_int(crcvalue); + + } + + } |
From: Rob <geo...@us...> - 2005-08-01 10:44:38
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27428/source/ais Modified Files: c_wussie.cpp Log Message: ai planet evasion improved Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** c_wussie.cpp 24 Jul 2005 00:28:53 -0000 1.15 --- c_wussie.cpp 1 Aug 2005 10:44:29 -0000 1.16 *************** *** 323,327 **** double b; ! b = ship->trajectory_angle(target); a = ship->angle - b; while (a < -PI) a += PI2; --- 323,327 ---- double b; ! b = ship->trajectory_angle(ship->target); a = ship->angle - b; while (a < -PI) a += PI2; *************** *** 953,959 **** } } planet_safe[k] = get_config_int (states, "Planet_Distance", 0); ! // if (planet_safe[k] == 0); //Launchpad, is this supposed to be here? ! planet_safe[k] = 75 * get_config_int ("ship", "Mass", 8); option_velocity[k][0] = scale_velocity (get_config_float --- 953,970 ---- } } + + // default to 0, if there's no such override setting. planet_safe[k] = get_config_int (states, "Planet_Distance", 0); ! ! if (planet_safe[k] == 0) //Launchpad, is this supposed to be here? Geo: yes, otherwise you can't have auto/override settings ! { ! planet_safe[k] = 75 * get_config_int ("ship", "Mass", 8); ! if (planet_safe[k] > 800.0) ! planet_safe[k] = 800.0; // let's not make it too big. ! if (planet_safe[k] < 400.0) ! planet_safe[k] = 400.0; // let's not make it too small. ! // note that a planet can be pretty big by itself ... ! } ! option_velocity[k][0] = scale_velocity (get_config_float |
From: Rob <geo...@us...> - 2005-08-01 10:44:05
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27323/ships Modified Files: shprogsq.ini Log Message: ai tweak Index: shprogsq.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shprogsq.ini,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shprogsq.ini 11 Jul 2005 00:25:09 -0000 1.7 --- shprogsq.ini 1 Aug 2005 10:43:56 -0000 1.8 *************** *** 51,54 **** --- 51,55 ---- Tactic_Min = 15 Tactic_Max = 50 + Planet_Distance = 500.0 [Formations] |
From: Rob <geo...@us...> - 2005-08-01 10:43:50
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27090/ships Modified Files: shpalckr.dat Log Message: Index: shpalckr.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpalckr.dat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsUsWpRz and /tmp/cvs6ycFY4 differ |
From: Rob <geo...@us...> - 2005-08-01 10:42:34
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26964/ships Modified Files: shpfresc.dat shprogsq.dat Log Message: new captain graphics Index: shprogsq.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shprogsq.dat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvseaP9Cc and /tmp/cvslef5dP differ Index: shpfresc.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpfresc.dat,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 Binary files /tmp/cvs2Zx96e and /tmp/cvsiduGJR differ |
From: Rob <geo...@us...> - 2005-07-24 00:29:10
|
Update of /cvsroot/timewarp/source/ais In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19229/source/ais Modified Files: c_wussie.cpp Log Message: fixed a pointer bug Index: c_wussie.cpp =================================================================== RCS file: /cvsroot/timewarp/source/ais/c_wussie.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** c_wussie.cpp 11 Jul 2005 00:25:11 -0000 1.14 --- c_wussie.cpp 24 Jul 2005 00:28:53 -0000 1.15 *************** *** 201,204 **** --- 201,207 ---- } + if (!(ship && ship->exists())) + ship = 0; + if (!ship) return 0; |
From: Rob <geo...@us...> - 2005-07-24 00:28:00
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18984/ships Modified Files: shpearc2.ini shpgahmo.ini shpkabwe.dat shpkabwe.ini shpstaba.ini Log Message: upgraded captain panel (and mentioned Deeko in the .ini file) Index: shpearc2.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpearc2.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpearc2.ini 17 Jul 2005 22:39:28 -0000 1.6 --- shpearc2.ini 24 Jul 2005 00:27:50 -0000 1.7 *************** *** 6,10 **** Coders = Tau Code = EarthlingCruiser2 ! GFX = unknown, panel=deeko [Ship] --- 6,10 ---- Coders = Tau Code = EarthlingCruiser2 ! GFX = unknown (ship), Deeko (captain) [Ship] Index: shpkabwe.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpkabwe.ini,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpkabwe.ini 15 Jul 2005 19:12:13 -0000 1.7 --- shpkabwe.ini 24 Jul 2005 00:27:50 -0000 1.8 *************** *** 4,8 **** Name2 = Weakener Origin = TWb ! Gfx = GeomanNL Sfx = none Coders = GeomanNL --- 4,8 ---- Name2 = Weakener Origin = TWb ! Gfx = GeomanNL (ship), Deeko (captain) Sfx = none Coders = GeomanNL Index: shpstaba.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpstaba.ini,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpstaba.ini 15 Nov 2003 11:04:18 -0000 1.4 --- shpstaba.ini 24 Jul 2005 00:27:50 -0000 1.5 *************** *** 7,10 **** --- 7,11 ---- ; = used their code for this ship :) Code = StarBase + Gfx = SC2 (ship), Deeko (captain) [Ship] Index: shpgahmo.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpgahmo.ini,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** shpgahmo.ini 11 Jul 2005 00:25:09 -0000 1.4 --- shpgahmo.ini 24 Jul 2005 00:27:50 -0000 1.5 *************** *** 8,12 **** Coders = Varith Code = GahmurMonitor ! Gfx = Mercutio [Ship] --- 8,12 ---- Coders = Varith Code = GahmurMonitor ! Gfx = Mercutio, Deeko (captains) [Ship] Index: shpkabwe.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpkabwe.dat,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 Binary files /tmp/cvsOWirRz and /tmp/cvs6do4s1 differ |
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1472/source/newships Modified Files: shparitr.cpp shpbipka.cpp shpchoex.cpp shpilwsp.cpp shpkatpo.cpp shpkoapa.cpp shpraame.cpp shprekas.cpp shpxxxma.cpp Log Message: key control fixes Index: shpkoapa.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkoapa.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpkoapa.cpp 21 Jul 2005 14:55:08 -0000 1.11 --- shpkoapa.cpp 23 Jul 2005 14:08:08 -0000 1.12 *************** *** 210,214 **** if(turboTimeLeft>0) { turboTimeLeft -= frame_time; ! this->nextkeys |= keyflag::thrust; } if(turboTimeLeft<=0&&turboOn==TRUE) --- 210,216 ---- if(turboTimeLeft>0) { turboTimeLeft -= frame_time; ! //this->nextkeys |= keyflag::thrust; ! if (control) ! control->keys |= keyflag::thrust; } if(turboTimeLeft<=0&&turboOn==TRUE) Index: shpkatpo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkatpo.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shpkatpo.cpp 11 Jul 2005 00:25:31 -0000 1.18 --- shpkatpo.cpp 23 Jul 2005 14:08:08 -0000 1.19 *************** *** 5,9 **** /* * created by: cy...@sc... ! */ class KatPoly : public Ship { public: --- 5,19 ---- /* * created by: cy...@sc... ! */ ! ! ! // allows other ships to affect control over a ship. ! class OverrideControlMorph : public OverrideControl ! { ! public: ! virtual void calculate(short *key); ! }; ! ! class KatPoly : public Ship { public: *************** *** 11,14 **** --- 21,26 ---- // the ship + OverrideControlMorph *ocm; + double weaponRange; double weaponVelocity; *************** *** 74,77 **** --- 86,91 ---- morph = NULL; // start unmorphed + + ocm = 0; } *************** *** 82,88 **** return morph ? 1 : 0; } ! int KatPoly::handle_damage( SpaceLocation* other, double normal, double direct ){ ! STACKTRACE ! if( !morph ) return Ship::handle_damage( other, normal, direct ); return 0; } --- 96,118 ---- return morph ? 1 : 0; } ! ! int KatPoly::handle_damage( SpaceLocation* other, double normal, double direct ) ! { ! STACKTRACE; ! if( !morph ) ! { ! Ship::handle_damage( other, normal, direct ); ! } ! ! if (!exists()) ! { ! // you have to include this here, cause a ship can die by external causes (through a handle-damage) ! // in which case, the control override should be removed... well, not that it really matters, cause ! // then the morph also dies, but well.. ! ! if (morph) ! morph->del_override_control(ocm); ! } ! return 0; } *************** *** 92,100 **** } ! void KatPoly::calculate(){ ! STACKTRACE ! if( morph ){ ! morph->nextkeys &= ~keyflag::special; // we will handle special so disable the morph's ! if( !morph->exists() ) { morph = 0; state = 0; // if the morph died we died as well --- 122,147 ---- } ! ! void OverrideControlMorph::calculate(short *key) ! { ! *key &= ~keyflag::special; // we will handle special so disable the morph's ! } ! ! ! void KatPoly::calculate() ! { ! STACKTRACE; ! ! if( morph ) ! { ! //morph->nextkeys &= ~keyflag::special; // we will handle special so disable the morph's ! //xxx hmmm ?? ! ! ! if( !morph->exists() ) ! { ! // first, remove the control override: ! morph->del_override_control(ocm); ! morph = 0; state = 0; // if the morph died we died as well *************** *** 112,120 **** void KatPoly::calculate_fire_weapon(){ if( !morph ) Ship::calculate_fire_weapon(); } ! int KatPoly::activate_weapon(){ ! STACKTRACE ! game->add( new KatAnimatedShot( this, Vector2(0, -size.y/2), angle, weaponVelocity, weaponDamage, ! weaponRange, weaponArmour, this, data->spriteWeapon, 64, time_ratio )); ! return true; } --- 159,170 ---- void KatPoly::calculate_fire_weapon(){ if( !morph ) Ship::calculate_fire_weapon(); } ! int KatPoly::activate_weapon() ! { ! STACKTRACE; ! ! game->add( new KatAnimatedShot( this, Vector2(0, -size.y/2), angle+PI, weaponVelocity, weaponDamage, ! weaponRange, weaponArmour, this, data->spriteWeapon, data->spriteWeapon->frames(), time_ratio )); ! ! return true; } *************** *** 151,155 **** if( !target->isShip()) return false; ! ShipType* morph_target; if( morph ) --- 201,205 ---- if( !target->isShip()) return false; ! ShipType* morph_target = 0; if( morph ) *************** *** 175,178 **** --- 225,232 ---- morph->control = 0; + // remove the special-override for the morph + morph->del_override_control(ocm); + ocm = 0; + } else { // if we have never yet morphed *************** *** 188,192 **** } // create the new ship ! // error: morph_target *can* be 0x000 morph = game->create_ship( morph_target->id, control, pos, angle, get_team() ); game->add( morph ); // add the ship --- 242,249 ---- } // create the new ship ! if (!morph_target) ! { ! tw_error("Kat Poly: morph target == 0."); ! } morph = game->create_ship( morph_target->id, control, pos, angle, get_team() ); game->add( morph ); // add the ship *************** *** 196,199 **** --- 253,261 ---- morph->vel = vel; update_panel = true; // maybe the colors changed + + // add control-override for the morph (disable its special key) + ocm = new OverrideControlMorph(); + morph->set_override_control(ocm); + return true; // we did it } Index: shprekas.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shprekas.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shprekas.cpp 11 Jul 2005 00:25:32 -0000 1.12 --- shprekas.cpp 23 Jul 2005 14:08:08 -0000 1.13 *************** *** 91,95 **** if (specialMatchSpeed) { ! nextkeys &= ~(keyflag::thrust); recharge_step=0; //recharge_rate=0;//Bad! --- 91,95 ---- if (specialMatchSpeed) { ! control->keys &= ~(keyflag::thrust); recharge_step=0; //recharge_rate=0;//Bad! Index: shpraame.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpraame.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shpraame.cpp 11 Jul 2005 00:25:32 -0000 1.17 --- shpraame.cpp 23 Jul 2005 14:08:08 -0000 1.18 *************** *** 200,204 **** angle=grabangle; grabshipangle = grabbed->get_angle(); ! nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust); // x = grabbed->normal_x()-((cos(grabangle )) * grabdistance); --- 200,206 ---- angle=grabangle; grabshipangle = grabbed->get_angle(); ! //nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust); ! if (control) ! control->keys &= ~(keyflag::left | keyflag::right | keyflag::thrust); // x = grabbed->normal_x()-((cos(grabangle )) * grabdistance); Index: shpchoex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpchoex.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpchoex.cpp 21 Jul 2005 14:55:07 -0000 1.14 --- shpchoex.cpp 23 Jul 2005 14:08:07 -0000 1.15 *************** *** 4,9 **** REGISTER_FILE /* ! Since this is my first ship, I obviously nabbed a lot of this code from other ship files. The sources of my inspiration: Chmmr Avatar for the planet-charge --- 4,19 ---- REGISTER_FILE + + // allows other ships to affect control over a ship. + class OverrideControlChorali : public OverrideControl + { + public: + virtual void calculate(short *key); + }; + + + /* ! Since this is my [Culture20] first ship, I obviously nabbed a lot of this code from other ship files. The sources of my inspiration: Chmmr Avatar for the planet-charge *************** *** 383,388 **** int tractorSpread; int amt_beams; - double old_angle; --- 393,398 ---- int tractorSpread; int amt_beams; + double grabbed_old_ship_angle, grabbed_old_enemy_angle; double old_angle; *************** *** 515,656 **** int ChoraliExtractor::activate_special() { ! STACKTRACE ! ! if(this->nearest_planet() != NULL) { ! spacePlanet = (SpaceLocation *) this->nearest_planet(); } ! ! if (spacePlanet != NULL) { ! if ((grabbed != NULL) && (grabbed->mass > 0)) ! { ! if (grabbed->mass + mass > 0) ! { ! grabbed->accelerate(this, grabbed->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + this->mass), MAX_SPEED); ! this->accelerate(this, this->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + this->mass), MAX_SPEED); ! } ! } ! else ! { ! if (mass > 0) ! this->accelerate(this, this->trajectory_angle(spacePlanet), specialForce / this->mass, MAX_SPEED); ! } ! } ! return (true); } void ChoraliExtractor::calculate() { ! STACKTRACE ! if(drillFrames > 0) ! { ! if(grabbed == NULL) ! { ! amt_beams=(random()%tractorMaxBeams)+1; ! ! for(int i=0;i<amt_beams;i++) ! { ! ! add(new ChoraliTractorBeam(this, (double)(angle+(((random() % tractorSpread) - (tractorSpread/2))*ANGLE_RATIO) ), ! makecol((random()%(tractorR-tractorRmin+1))+tractorRmin, (random()%(tractorG-tractorGmin+1))+tractorGmin, (random()%(tractorB-tractorBmin+1))+tractorBmin), ! tractorRange, tractorDamage, tractorRate, this, 0.0, 0.0, true, tractorForce, tractorPushForce)); ! ! } ! if(count>=PI) ! { count=0; ! } ! if(count==0) ! { ! play_sound2(data->sampleExtra[0]); ! } ! count++; ! ! } ! ! drillFrames-= frame_time; ! if ((drillFrames <= 0) && (!latched)) ! { ! play_sound2(data->sampleWeapon[0]); ! } ! } ! else ! { ! latched = FALSE; ! grabbed = NULL; ! } ! ! if (grabbed != NULL) ! { ! if (!(grabbed->exists()) || grabbed->damage_factor > 0) ! { ! // if it does not exist, or the target deals damage, then, release it again. ! // This is because of the following report: ! // "When a Chorhli grabs a guardian, it still hangs on if it goes into blazer form, ! // killing it almost instantly. A bit unfair, no. " ! ! latched = FALSE; ! grabbed = NULL; ! } ! } ! ! if (latched) ! { ! damageFrameLeft-=frame_time; ! if (damageFrameLeft <=0) ! { ! damageFrameLeft += damageFrameAmount; ! if (drillDamageLeft < drillDamagePerDamageFrame) ! damage(grabbed, drillDamageLeft); ! else ! { ! damage(grabbed,drillDamagePerDamageFrame); ! drillDamageLeft -= drillDamagePerDamageFrame; ! } ! ! ! } ! grabangle = (grabbed->get_angle() - grabshipangle) + grabangle; ! ! grabshipangle = grabbed->get_angle(); ! if(grabbed->isShip()) ! { ! //turn enemy when ChoraliExtractor turns ! ((Ship*)grabbed)->turn_step -= (old_angle - angle); ! ! //limit enemy movement ! ((Ship*)grabbed)->nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust); ! ! //twist the enemy ! if (grabbed->trajectory_angle(this) <= grabbed->get_angle() ) ! { ! if ((grabbed->get_angle() - grabbed->trajectory_angle(this)) <= PI) ! {((Ship*)grabbed)->angle+=CH_TWIST_ANGLE*frame_time/25.0; ! } ! else ! {((Ship*)grabbed)->angle-=CH_TWIST_ANGLE*frame_time/25.0; ! } ! } ! else ! { ! if ((grabbed->trajectory_angle(this) - grabbed->get_angle()) <= PI) ! {((Ship*)grabbed)->angle-=CH_TWIST_ANGLE*frame_time/25.0; ! } ! else ! {((Ship*)grabbed)->angle+=CH_TWIST_ANGLE*frame_time/25.0; ! } ! } ! ! } ! ! grabbed->pos = this->normal_pos() - unit_vector(angle+PI) * grabdistance; ! grabbed->vel = this->vel; ! } ! old_angle = angle; ! Ship::calculate(); } --- 525,681 ---- int ChoraliExtractor::activate_special() { ! STACKTRACE; ! ! if(this->nearest_planet() != NULL) { ! spacePlanet = (SpaceLocation *) this->nearest_planet(); } ! ! if (spacePlanet != NULL) { ! if ((grabbed != NULL) && (grabbed->mass > 0)) ! { ! if (grabbed->mass + mass > 0) ! { ! // a bit lame to accelerate towards the planet. It's nicer if you move to the planet yourself. ! //grabbed->accelerate(this, grabbed->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + mass), MAX_SPEED); ! //accelerate(this, trajectory_angle(spacePlanet), specialForce / (grabbed->mass + mass), MAX_SPEED); ! grabbed->vel = vel; ! double a = angle;//trajectory_angle(grabbed); ! double dv = specialForce / (grabbed->mass + mass); ! grabbed->accelerate(this, a, dv * grabbed->mass, MAX_SPEED); ! accelerate(this, a+PI, dv * mass, MAX_SPEED); ! ! latched = FALSE; ! grabbed = NULL; ! drillFrames = 0; ! } ! ! } ! else ! { ! if (mass > 0) ! this->accelerate(this, trajectory_angle(spacePlanet), specialForce / mass, MAX_SPEED); ! } ! } ! ! return (true); } void ChoraliExtractor::calculate() { ! STACKTRACE; ! if(drillFrames > 0) ! { ! if(grabbed == NULL) ! { ! amt_beams=(random()%tractorMaxBeams)+1; ! ! for(int i=0;i<amt_beams;i++) ! { ! ! add(new ChoraliTractorBeam(this, (double)(angle+(((random() % tractorSpread) - (tractorSpread/2))*ANGLE_RATIO) ), ! makecol((random()%(tractorR-tractorRmin+1))+tractorRmin, (random()%(tractorG-tractorGmin+1))+tractorGmin, (random()%(tractorB-tractorBmin+1))+tractorBmin), ! tractorRange, tractorDamage, tractorRate, this, 0.0, 0.0, true, tractorForce, tractorPushForce)); ! ! } ! if(count>=PI) ! { count=0; ! } ! if(count==0) ! { ! play_sound2(data->sampleExtra[0]); ! } ! count++; ! ! } ! drillFrames-= frame_time; ! if ((drillFrames <= 0) && (!latched)) ! { ! play_sound2(data->sampleWeapon[0]); ! } ! } ! else ! { ! latched = FALSE; ! grabbed = NULL; ! } ! ! if (grabbed != NULL) ! { ! if (!(grabbed->exists()) || grabbed->damage_factor > 0) ! { ! // if it does not exist, or the target deals damage, then, release it again. ! // This is because of the following report: ! // "When a Chorhli grabs a guardian, it still hangs on if it goes into blazer form, ! // killing it almost instantly. A bit unfair, no. " ! ! latched = FALSE; ! grabbed = NULL; ! } ! } ! ! if (latched) ! { ! damageFrameLeft-=frame_time; ! if (damageFrameLeft <=0) ! { ! damageFrameLeft += damageFrameAmount; ! if (drillDamageLeft < drillDamagePerDamageFrame) ! damage(grabbed, drillDamageLeft); ! else ! { ! damage(grabbed,drillDamagePerDamageFrame); ! drillDamageLeft -= drillDamagePerDamageFrame; ! } ! ! ! } ! grabangle = (grabbed->get_angle() - grabshipangle) + grabangle; ! ! grabshipangle = grabbed->get_angle(); ! if(grabbed->isShip()) ! { ! //turn enemy when ChoraliExtractor turns ! // ((Ship*)grabbed)->turn_step -= (old_angle - angle); ! ! //limit enemy movement ! //((Ship*)grabbed)->nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust); ! // easier: override enemy position (uhm... but that's done below) and enemy angle (here). ! grabbed->angle = grabbed_old_enemy_angle + (angle - grabbed_old_ship_angle); ! ((Ship*)grabbed)->turn_step = 0; ! ! ! //twist the enemy ! if (grabbed->trajectory_angle(this) <= grabbed->get_angle() ) ! { ! if ((grabbed->get_angle() - grabbed->trajectory_angle(this)) <= PI) ! {((Ship*)grabbed)->angle+=CH_TWIST_ANGLE*frame_time/25.0; ! } ! else ! {((Ship*)grabbed)->angle-=CH_TWIST_ANGLE*frame_time/25.0; ! } ! } ! else ! { ! if ((grabbed->trajectory_angle(this) - grabbed->get_angle()) <= PI) ! {((Ship*)grabbed)->angle-=CH_TWIST_ANGLE*frame_time/25.0; ! } ! else ! {((Ship*)grabbed)->angle+=CH_TWIST_ANGLE*frame_time/25.0; ! } ! } ! ! } ! ! grabbed->pos = this->normal_pos() - unit_vector(angle+PI) * grabdistance; ! grabbed->vel = this->vel; ! } ! old_angle = angle; ! Ship::calculate(); } *************** *** 675,717 **** void ChoraliExtractor::inflict_damage(SpaceObject *other) { ! STACKTRACE ! if (drillFrames > 0) { ! if (!latched) ! { ! if ((!(sameTeam(other))) && (other->isShip() || other->isAsteroid())) ! { ! if((this->trajectory_angle(other) <= angle+45) && (this->trajectory_angle(other) >= angle-45)) { ! latched=TRUE; ! grabbed= (SpaceObject *) other; ! grabbed->vel = this->vel; ! grabangle= (trajectory_angle(other) ); ! grabdistance = (distance(other) * 1.1); ! grabshipangle = (other->get_angle()); ! drillDamageLeft = weaponDamage; ! play_sound2(data->sampleExtra[1]); ! if ((drillFrames / frame_time)< weaponDamage) ! { ! drillDamagePerDamageFrame = (weaponDamage/drillFrames) ! + ((weaponDamage % drillFrames) > 0.00001); ! damageFrameLeft = 1; ! damageFrameAmount = 1; ! } ! else ! { ! damageFrameAmount = (drillFrames/weaponDamage); ! damageFrameLeft = damageFrameAmount; ! drillDamagePerDamageFrame = 0; ! } } - } - } - else //if latched - { - - } } ! Ship::inflict_damage(other); } --- 700,744 ---- void ChoraliExtractor::inflict_damage(SpaceObject *other) { ! STACKTRACE; ! if (drillFrames > 0) { ! if (!latched) { ! if ((!(sameTeam(other))) && (other->isShip() || other->isAsteroid())) ! { ! if((this->trajectory_angle(other) <= angle+45) && (this->trajectory_angle(other) >= angle-45)) ! { ! latched=TRUE; ! grabbed= (SpaceObject *) other; ! grabbed->vel = this->vel; ! grabangle= (trajectory_angle(other) ); ! grabdistance = (distance(other) * 1.1); ! grabshipangle = (other->get_angle()); ! grabbed_old_enemy_angle = other->get_angle(); ! grabbed_old_ship_angle = angle; ! drillDamageLeft = weaponDamage; ! play_sound2(data->sampleExtra[1]); ! if ((drillFrames / frame_time)< weaponDamage) ! { ! drillDamagePerDamageFrame = (weaponDamage/drillFrames) ! + ((weaponDamage % drillFrames) > 0.00001); ! damageFrameLeft = 1; ! damageFrameAmount = 1; ! } ! else ! { ! damageFrameAmount = (drillFrames/weaponDamage); ! damageFrameLeft = damageFrameAmount; ! drillDamagePerDamageFrame = 0; ! } ! } ! } ! } ! else //if latched ! { ! } } ! Ship::inflict_damage(other); } Index: shparitr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shparitr.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shparitr.cpp 11 Jul 2005 00:25:29 -0000 1.15 --- shparitr.cpp 23 Jul 2005 14:08:03 -0000 1.16 *************** *** 87,91 **** { pos = ship->normal_pos(); ! ship->nextkeys &= ~(keyflag::left | keyflag::right | keyflag::special | keyflag::thrust | keyflag::back | keyflag::fire | keyflag::altfire); // must be unconditional, outside the loop (otherwise virtually 1 extra loop/waittime is added) --- 87,94 ---- { pos = ship->normal_pos(); ! ! ! // the ship is probably nicer without this "trap" ability. ! //ship->nextkeys &= ~(keyflag::left | keyflag::right | keyflag::special | keyflag::thrust | keyflag::back | keyflag::fire | keyflag::altfire); // must be unconditional, outside the loop (otherwise virtually 1 extra loop/waittime is added) Index: shpxxxma.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpxxxma.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** shpxxxma.cpp 21 Jul 2005 14:55:08 -0000 1.19 --- shpxxxma.cpp 23 Jul 2005 14:08:08 -0000 1.20 *************** *** 9,13 **** #include "shpilwsp.h" - //class XXXManglerMine; --- 9,12 ---- *************** *** 284,288 **** grabshipangle = normalize(grabbed->get_angle(),PI2); ! nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust | keyflag::special | keyflag::fire); // x = grabbed->normal_x()- (cos(grabangle ) * grabdistance); --- 283,289 ---- grabshipangle = normalize(grabbed->get_angle(),PI2); ! //nextkeys &= ~(keyflag::left | keyflag::right | keyflag::thrust | keyflag::special | keyflag::fire); ! if (control) ! control->keys &= ~(keyflag::left | keyflag::right | keyflag::thrust | keyflag::special | keyflag::fire); // x = grabbed->normal_x()- (cos(grabangle ) * grabdistance); Index: shpilwsp.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpilwsp.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpilwsp.cpp 11 Jul 2005 00:25:31 -0000 1.13 --- shpilwsp.cpp 23 Jul 2005 14:08:08 -0000 1.14 *************** *** 173,179 **** game->add( new FixedAnimation( this, other, data->spriteExtra, 0, data->spriteExtra->frames(), time_ratio, LAYER_EXPLOSIONS )); ! if( other->vel != 0 ){ other->vel = 0; ! if( other->isShip() ) ((Ship*)other)->nextkeys &= ~(keyflag::thrust | keyflag::left | keyflag::right); game->add( new IlwrathStop( this, other, stoptime )); --- 173,180 ---- game->add( new FixedAnimation( this, other, data->spriteExtra, 0, data->spriteExtra->frames(), time_ratio, LAYER_EXPLOSIONS )); ! if( other->vel != 0 ) ! { other->vel = 0; ! //if( other->isShip() ) ((Ship*)other)->nextkeys &= ~(keyflag::thrust | keyflag::left | keyflag::right); game->add( new IlwrathStop( this, other, stoptime )); *************** *** 191,233 **** IlwrathStop::IlwrathStop( SpaceLocation* creator, SpaceObject* ovictim, int olife ): ! SpaceLocation( creator, 0, 0 ), ! victim( ovictim ), life( olife ) { ! if( victim ){ ! if( !victim->exists() ){ ! victim = 0; ! state = 0; ! }else{ ! if( victim->isShot() ){ ! old_v = ((Shot*)victim)->v; ! ((Shot*)victim)->v = 0; ! }else{ ! old_v = 0; ! } ! } ! } } void IlwrathStop::calculate() { ! STACKTRACE ! SpaceLocation::calculate(); ! if( !(victim && victim->exists()) ) ! { ! victim = 0; ! state = 0; ! return; ! } ! if( victim->isShip() ) ((Ship*)victim)->nextkeys &= ~(keyflag::thrust | keyflag::left | keyflag::right); ! victim->vel = 0; - life -= frame_time; - if( life <= 0 ){ - state = 0; - if( victim->isShot() ){ - ((Shot*)victim)->v = old_v; - victim->vel = old_v * unit_vector(victim->get_angle()); - } - } } --- 192,257 ---- IlwrathStop::IlwrathStop( SpaceLocation* creator, SpaceObject* ovictim, int olife ): ! SpaceLocation( creator, 0, 0 ), ! victim( ovictim ), life( olife ) { ! if( victim ) ! { ! if( !victim->exists() ) ! { ! victim = 0; ! state = 0; ! } else { ! if( victim->isShot() ) ! { ! old_v = ((Shot*)victim)->v; ! ((Shot*)victim)->v = 0; ! } else { ! old_v = 0; ! ! // reduce turn rate ! if (victim->isShip()) ! ((Ship*)victim)->turn_rate *= 0.5; ! } ! } ! } } void IlwrathStop::calculate() { ! STACKTRACE; ! SpaceLocation::calculate(); ! ! if( !(victim && victim->exists()) ) ! { ! victim = 0; ! state = 0; ! } ! ! if (victim) ! { ! //if( victim->isShip() ) ((Ship*)victim)->nextkeys &= ~(keyflag::thrust | keyflag::left | keyflag::right); ! // this is not necessary, cause the velocity is already being overridden. And who cares about left/right. ! victim->vel = 0; ! ! life -= frame_time; ! if( life <= 0 ){ ! state = 0; ! if( victim->isShot() ){ ! ((Shot*)victim)->v = old_v; ! victim->vel = old_v * unit_vector(victim->get_angle()); ! } ! } ! } ! ! if (!exists()) ! { ! if (victim) ! { ! // restore turn rate ! if (victim->isShip()) ! ((Ship*)victim)->turn_rate *= 2.0; ! } ! } } Index: shpbipka.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbipka.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpbipka.cpp 11 Jul 2005 00:25:29 -0000 1.14 --- shpbipka.cpp 23 Jul 2005 14:08:03 -0000 1.15 *************** *** 323,331 **** if( !left || !right ) return; if( left->turn_left ){ ! left->nextkeys &= ~keyflag::thrust; left->accelerate(this, left->get_angle(), -extraBackThrust * accel_rate * frame_time, speed_max); } if( right->turn_left ){ ! right->nextkeys |= keyflag::thrust; right->accelerate(this, right->get_angle(), accel_rate * frame_time, speed_max); } --- 323,331 ---- if( !left || !right ) return; if( left->turn_left ){ ! // left->nextkeys &= ~keyflag::thrust; this disabling isn't really needed, cause sibling check is done there already ? left->accelerate(this, left->get_angle(), -extraBackThrust * accel_rate * frame_time, speed_max); } if( right->turn_left ){ ! // right->nextkeys |= keyflag::thrust; right->accelerate(this, right->get_angle(), accel_rate * frame_time, speed_max); } *************** *** 335,343 **** if( !left || !right ) return; if( left->turn_right ){ ! left->nextkeys |= keyflag::thrust; left->accelerate(this, left->get_angle(), accel_rate * frame_time, speed_max); } if( right->turn_right ){ ! right->nextkeys &= ~keyflag::thrust; right->accelerate(this, right->get_angle(), -extraBackThrust * accel_rate * frame_time, speed_max); } --- 335,343 ---- if( !left || !right ) return; if( left->turn_right ){ ! // left->nextkeys |= keyflag::thrust; left->accelerate(this, left->get_angle(), accel_rate * frame_time, speed_max); } if( right->turn_right ){ ! // right->nextkeys &= ~keyflag::thrust; right->accelerate(this, right->get_angle(), -extraBackThrust * accel_rate * frame_time, speed_max); } |
From: Rob <geo...@us...> - 2005-07-23 14:07:36
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1368/source/newships Modified Files: shpmontr.cpp Log Message: graphics bug fix (sprite count) Index: shpmontr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpmontr.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpmontr.cpp 11 Jul 2005 00:25:32 -0000 1.10 --- shpmontr.cpp 23 Jul 2005 14:07:27 -0000 1.11 *************** *** 272,275 **** --- 272,277 ---- set_up_beacons(); last_target = target; + + attributes &= ~ATTRIB_STANDARD_INDEX; } |
From: Rob <geo...@us...> - 2005-07-23 14:07:05
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1288/source/sc2ships Modified Files: shpslypr.cpp Log Message: invalid-pointer bug fix Index: shpslypr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpslypr.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpslypr.cpp 11 Jul 2005 00:25:59 -0000 1.16 --- shpslypr.cpp 23 Jul 2005 14:06:56 -0000 1.17 *************** *** 288,293 **** Presence::calculate(); ! double ! relativelifetime = lifetime / existtime; // a value increasing from 0 to 1 Vector2 S, D; --- 288,292 ---- Presence::calculate(); ! double relativelifetime = lifetime / existtime; // a value increasing from 0 to 1 Vector2 S, D; *************** *** 297,303 **** int directedbeam; if (!(target && target->exists())) directedbeam = 0; ! else directedbeam = 1; if ( directedbeam ) --- 296,306 ---- int directedbeam; if (!(target && target->exists())) + { directedbeam = 0; ! target = 0; ! } else { directedbeam = 1; + } + if ( directedbeam ) *************** *** 316,320 **** SpaceSprite *tsprite; ! if ( directedbeam ) tsprite = target->ship->get_sprite(); else --- 319,323 ---- SpaceSprite *tsprite; ! if ( directedbeam && target->ship && target->ship->exists() ) tsprite = target->ship->get_sprite(); else |
From: Rob <geo...@us...> - 2005-07-23 14:06:15
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1119/ships Modified Files: shpgahmo.dat shpkabwe.dat shpxxxma.ini Log Message: new captain panels Index: shpxxxma.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpxxxma.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpxxxma.ini 15 Feb 2004 16:37:51 -0000 1.6 --- shpxxxma.ini 23 Jul 2005 14:06:06 -0000 1.7 *************** *** 36,40 **** LifeTime = 8000 Randomness = 0.05 ! StopTime = 500 [SpecialOld] --- 36,40 ---- LifeTime = 8000 Randomness = 0.05 ! StopTime = 750 [SpecialOld] Index: shpgahmo.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpgahmo.dat,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvs03unT4 and /tmp/cvskPZgMl differ Index: shpkabwe.dat =================================================================== RCS file: /cvsroot/timewarp/ships/shpkabwe.dat,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvstkT3Je and /tmp/cvsCFu5Hv differ |
From: Rob <geo...@us...> - 2005-07-21 15:24:55
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12160/source/newships Modified Files: shptaule.cpp Log Message: another pointer error... related to the control override. Index: shptaule.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaule.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shptaule.cpp 21 Jul 2005 00:43:59 -0000 1.18 --- shptaule.cpp 21 Jul 2005 15:24:47 -0000 1.19 *************** *** 574,583 **** FixedAnimation::calculate(); - // perform this test here, cause there's a return later on... - if (!exists()) - { - if (victim) - victim->del_override_control(ocl); - } if (victim) --- 574,577 ---- *************** *** 585,607 **** if (!victim->exists()) { ! victim->del_override_control(ocl); victim = 0; state = 0; ! return; } - //((Ship*)victim)->nextkeys &= ~(keyflag::left + keyflag::right + keyflag::thrust); - Vector2 vv = victim->get_vel(); - double vvv = magnitude(vv); - - if (vvv < 1e-5) - return; - - vvv = (vvv - ((Ship*)victim)->accel_rate * frame_time) / vvv; - if (vvv < 0) vvv = 0; - vv *= (vvv - 1); - vvv = magnitude(vv); - victim->accelerate(victim, atan(vv), vvv, MAX_SPEED); } } --- 579,610 ---- if (!victim->exists()) { ! //victim->del_override_control(ocl); victim = 0; state = 0; ! //return; ! } ! else ! { ! //((Ship*)victim)->nextkeys &= ~(keyflag::left + keyflag::right + keyflag::thrust); ! Vector2 vv = victim->get_vel(); ! double vvv = magnitude(vv); ! ! if (vvv < 1e-5) ! return; ! ! vvv = (vvv - ((Ship*)victim)->accel_rate * frame_time) / vvv; ! if (vvv < 0) vvv = 0; ! vv *= (vvv - 1); ! vvv = magnitude(vv); ! victim->accelerate(victim, atan(vv), vvv, MAX_SPEED); } } + // perform this test here, cause there's a return later on... + if (!exists()) + { + if (victim) + victim->del_override_control(ocl); + } } |
From: Rob <geo...@us...> - 2005-07-21 14:58:20
|
Update of /cvsroot/timewarp/source/melee In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5463/source/melee Modified Files: mframe.cpp mship.cpp Log Message: There were some unprotected divisions by (other) mass. I've added some protection. Also, new-ship selection (in control) could end up in an infinite loop; is also fixed now. Index: mship.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mship.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** mship.cpp 16 Jul 2005 23:48:51 -0000 1.35 --- mship.cpp 21 Jul 2005 14:55:07 -0000 1.36 *************** *** 668,678 **** int i; ! if (target_pressed && (!target_pressed_prev) && control) { ! if (target_next) { ! if (control && targets->N) { i = control->index; ! if (i < 0) i = 0; ! while (1) { i = (i + 1) % targets->N; if (control->valid_target(targets->item[i])) { control->set_target(i); --- 668,688 ---- int i; ! if (target_pressed && (!target_pressed_prev) && control) ! { ! ! if (target_next) ! { ! if (control && targets->N) ! { i = control->index; ! if (i < 0) ! i = 0; ! if (i > targets->N - 1) ! i = targets->N - 1; ! ! while (1) ! { i = (i + 1) % targets->N; + if (control->valid_target(targets->item[i])) { control->set_target(i); *************** *** 688,702 **** } } else if (target_prev) { if (control && targets->N) { i = control->index; ! if (i < 0) i = 0; ! int k = 0; while (1) { ! ++k; ! if ( k > targets->N - 1) k = targets->N - 1; if (k == i) { --- 698,719 ---- } } + else if (target_prev) { if (control && targets->N) { i = control->index; ! ! if (i < 0) ! i = 0; ! if (i > targets->N - 1) ! i = targets->N - 1; ! ! int k = i; while (1) { ! --k; ! if ( k < 0 ) k = targets->N - 1; + if (k == i) { Index: mframe.cpp =================================================================== RCS file: /cvsroot/timewarp/source/melee/mframe.cpp,v retrieving revision 1.32 retrieving revision 1.33 diff -C2 -d -r1.32 -r1.33 *** mframe.cpp 11 Jul 2005 21:57:19 -0000 1.32 --- mframe.cpp 21 Jul 2005 14:55:06 -0000 1.33 *************** *** 764,773 **** tmp = dot_product(dv, _dp); tmp = ( -2 * tmp ); ! tmp = tmp * (mass * other->mass) / (mass + other->mass); if (tmp >= 0) { //vel += _dp * tmp / mass; //other->vel -= _dp * tmp / other->mass; ! change_vel(_dp * tmp / mass); ! other->change_vel( -_dp * tmp / other->mass); } --- 764,780 ---- tmp = dot_product(dv, _dp); tmp = ( -2 * tmp ); ! ! double a = mass + other->mass; ! if (a > 0) ! tmp = tmp * (mass * other->mass) / (a); ! if (tmp >= 0) { //vel += _dp * tmp / mass; //other->vel -= _dp * tmp / other->mass; ! if (mass > 0) ! change_vel(_dp * tmp / mass); ! ! if (other->mass > 0) ! other->change_vel( -_dp * tmp / other->mass); } |
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5463/source/newships Modified Files: shpastba.cpp shpbogce.cpp shpchoex.cpp shpconca.cpp shpcrore.cpp shpducla.cpp shpfiear.cpp shpgahmo.cpp shpgarty.cpp shpjygst.cpp shpkoaja.cpp shpkoapa.cpp shpkorsi.cpp shpneccr.cpp shpsefn2.cpp shpvezba.cpp shpxilcr.cpp shpxxxma.cpp Log Message: There were some unprotected divisions by (other) mass. I've added some protection. Also, new-ship selection (in control) could end up in an infinite loop; is also fixed now. Index: shpkoapa.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkoapa.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** shpkoapa.cpp 11 Jul 2005 00:25:32 -0000 1.10 --- shpkoapa.cpp 21 Jul 2005 14:55:08 -0000 1.11 *************** *** 297,300 **** --- 297,302 ---- if(framesOfBurn>=0) { framesOfBurn -= frame_time; + + if (mass > 0) accelerate_gravwhip (this, facingAngle, acceleration / mass, maxSpeed); } Index: shpchoex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpchoex.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpchoex.cpp 11 Jul 2005 00:25:29 -0000 1.13 --- shpchoex.cpp 21 Jul 2005 14:55:07 -0000 1.14 *************** *** 44,48 **** sprite_index = random()%64; tractorForce=tforce; ! this->accelerate(creator, this->trajectory_angle(creator), tractorForce / (this->mass * 2), 6); } void AsteroidDebris::calculate() --- 44,50 ---- sprite_index = random()%64; tractorForce=tforce; ! ! if (mass > 0) ! this->accelerate(creator, this->trajectory_angle(creator), tractorForce / (this->mass * 2), 6); } void AsteroidDebris::calculate() *************** *** 166,169 **** --- 168,172 ---- if ((other->mass > 0) && ( other->isShip() || other->isAsteroid() )) { + other->accelerate(this, other->trajectory_angle(this), tractorForce / (other->mass * 4), 2); if(other->isShip()) *************** *** 200,204 **** else if (other->isShot()) {//if It's a weapon Shot ! other->accelerate(this, (other->trajectory_angle(this) + PI), (tractorPushForce / ((other->mass * 3)+20)), MAX_SPEED); } --- 203,208 ---- else if (other->isShot()) {//if It's a weapon Shot ! if (other->mass > 0) ! other->accelerate(this, (other->trajectory_angle(this) + PI), (tractorPushForce / ((other->mass * 3)+20)), MAX_SPEED); } *************** *** 522,530 **** if ((grabbed != NULL) && (grabbed->mass > 0)) { ! grabbed->accelerate(this, grabbed->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + this->mass), MAX_SPEED); ! this->accelerate(this, this->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + this->mass), MAX_SPEED); } else { this->accelerate(this, this->trajectory_angle(spacePlanet), specialForce / this->mass, MAX_SPEED); } --- 526,540 ---- if ((grabbed != NULL) && (grabbed->mass > 0)) { ! if (grabbed->mass + mass > 0) ! { ! grabbed->accelerate(this, grabbed->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + this->mass), MAX_SPEED); ! ! this->accelerate(this, this->trajectory_angle(spacePlanet), specialForce / (grabbed->mass + this->mass), MAX_SPEED); ! } ! } else { + if (mass > 0) this->accelerate(this, this->trajectory_angle(spacePlanet), specialForce / this->mass, MAX_SPEED); } Index: shpvezba.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpvezba.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpvezba.cpp 11 Jul 2005 00:25:32 -0000 1.14 --- shpvezba.cpp 21 Jul 2005 14:55:08 -0000 1.15 *************** *** 311,327 **** } ! void VezlagariBulkhead::inflict_damage(SpaceObject *other) { ! STACKTRACE ! int x; ! if(other->isShip() || other->isAsteroid() || other->isPlanet()) { ! damage(other, normal, direct); ! //SpaceObject::inflict_damage(other); ! if(creator) { ! x = iround(1 - (damageAbsorbed / resilience)); ! if(x<0)x=0; ! if(!other->isPlanet()) other->accelerate (other, creator->trajectory_angle(other), creator->specialRepulse / other->mass, MAX_SPEED); ! creator->accelerate (creator, other->trajectory_angle(creator), creator->specialRepulse / creator->mass, MAX_SPEED); ! } ! } } --- 311,335 ---- } ! void VezlagariBulkhead::inflict_damage(SpaceObject *other) ! { ! STACKTRACE; ! int x; ! if(other->isShip() || other->isAsteroid() || other->isPlanet()) ! { ! damage(other, normal, direct); ! //SpaceObject::inflict_damage(other); ! if(creator) { ! x = iround(1 - (damageAbsorbed / resilience)); ! ! if(x < 0) ! x = 0; ! ! if(!other->isPlanet() && other->mass) ! other->accelerate (other, creator->trajectory_angle(other), creator->specialRepulse / other->mass, MAX_SPEED); ! ! if (creator->mass) ! creator->accelerate (creator, other->trajectory_angle(creator), creator->specialRepulse / creator->mass, MAX_SPEED); ! } ! } } Index: shpcrore.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpcrore.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpcrore.cpp 11 Jul 2005 00:25:29 -0000 1.7 --- shpcrore.cpp 21 Jul 2005 14:55:07 -0000 1.8 *************** *** 154,167 **** t = specialTranslate * (1 - r) * frame_time; ! if (q.currento->isPlanet()) { xp = p / sqrt(mass); ! xt = t / sqrt(mass); } else { ! if (q.currento->mass > 1) { xp = (p / sqrt(mass)) * (1-1/sqrt(q.currento->mass)); xt = (t / sqrt(mass)) * (1-1/sqrt(q.currento->mass)); p /= sqrt(q.currento->mass); ! t /= sqrt(q.currento->mass); } } // ovx = q.currento->get_vx(); --- 154,176 ---- t = specialTranslate * (1 - r) * frame_time; ! xp = p; ! xt = t; ! ! if (q.currento->isPlanet()) ! { ! if (mass >= 1) ! { xp = p / sqrt(mass); ! xt = t / sqrt(mass); ! } ! } else { ! if (q.currento->mass > 1 && mass > 1) { xp = (p / sqrt(mass)) * (1-1/sqrt(q.currento->mass)); xt = (t / sqrt(mass)) * (1-1/sqrt(q.currento->mass)); p /= sqrt(q.currento->mass); ! t /= sqrt(q.currento->mass); } ! } // ovx = q.currento->get_vx(); Index: shpsefn2.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpsefn2.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpsefn2.cpp 11 Jul 2005 19:53:48 -0000 1.8 --- shpsefn2.cpp 21 Jul 2005 14:55:08 -0000 1.9 *************** *** 446,454 **** tmp = dot_product(dv, _dp); tmp = ( -2 * tmp ); ! tmp = tmp * (mass * other->mass) / (mass + other->mass); if (tmp >= 0) { vel += _dp * tmp / mass; ! other->vel -= _dp * tmp / other->mass; } --- 446,460 ---- tmp = dot_product(dv, _dp); tmp = ( -2 * tmp ); ! ! double a = mass + other->mass; ! if (a > 0) ! tmp = tmp * (mass * other->mass) / (a); ! if (tmp >= 0) { vel += _dp * tmp / mass; ! ! if (other->mass > 0) ! other->vel -= _dp * tmp / other->mass; } Index: shpconca.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpconca.cpp,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** shpconca.cpp 11 Jul 2005 00:25:29 -0000 1.16 --- shpconca.cpp 21 Jul 2005 14:55:07 -0000 1.17 *************** *** 447,451 **** // as above, but now only in the direction of the bar: double vfinal; ! vfinal = ( first->mass * v1 + second->mass * v2) / (first->mass + second->mass); first->vel += (vfinal - v1) * L; --- 447,455 ---- // as above, but now only in the direction of the bar: double vfinal; ! ! if (first->mass + second->mass > 1) ! vfinal = ( first->mass * v1 + second->mass * v2) / (first->mass + second->mass); ! else ! vfinal = first->mass * v1 + second->mass * v2; first->vel += (vfinal - v1) * L; Index: shpastba.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpastba.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpastba.cpp 11 Jul 2005 00:25:29 -0000 1.5 --- shpastba.cpp 21 Jul 2005 14:55:07 -0000 1.6 *************** *** 841,845 **** // as above, but now only in the direction of the bar: double vfinal; ! vfinal = ( first->mass * v1 + second->mass * v2) / (first->mass + second->mass); first->vel += (vfinal - v1) * L; --- 841,848 ---- // as above, but now only in the direction of the bar: double vfinal; ! if (first->mass + second->mass > 0) ! vfinal = ( first->mass * v1 + second->mass * v2) / (first->mass + second->mass); ! else ! vfinal = 0; first->vel += (vfinal - v1) * L; *************** *** 855,859 **** v = magnitude( first->vel - L*first->vel.dot(L) ); // the perpendicular component ! accel += L * (first->mass / second->mass) * sqr(v) / Seg_Distance; SpaceObject *third; --- 858,863 ---- v = magnitude( first->vel - L*first->vel.dot(L) ); // the perpendicular component ! if (second->mass > 0) ! accel += L * (first->mass / second->mass) * sqr(v) / Seg_Distance; SpaceObject *third; *************** *** 867,871 **** v = magnitude( third->vel - L2*third->vel.dot(L2) ); // the perpendicular component ! accel -= L2 * (third->mass / second->mass) * sqr(v) / Seg_Distance; } --- 871,877 ---- v = magnitude( third->vel - L2*third->vel.dot(L2) ); // the perpendicular component ! ! if (second->mass > 0) ! accel -= L2 * (third->mass / second->mass) * sqr(v) / Seg_Distance; } Index: shpbogce.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpbogce.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpbogce.cpp 11 Jul 2005 00:25:29 -0000 1.5 --- shpbogce.cpp 21 Jul 2005 14:55:07 -0000 1.6 *************** *** 434,438 **** void BoggCenturionMissile::inflict_damage(SpaceObject *other) { ! if ((!other->isPlanet()) && (other->mass)) other->accelerate(this, normalize(trajectory_angle(other), 360), blast_accel/other->mass, blast_maxspeed); Missile::inflict_damage(other); --- 434,438 ---- void BoggCenturionMissile::inflict_damage(SpaceObject *other) { ! if ((!other->isPlanet()) && (other->mass > 0)) other->accelerate(this, normalize(trajectory_angle(other), 360), blast_accel/other->mass, blast_maxspeed); Missile::inflict_damage(other); Index: shpxilcr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpxilcr.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpxilcr.cpp 11 Jul 2005 00:25:32 -0000 1.15 --- shpxilcr.cpp 21 Jul 2005 14:55:08 -0000 1.16 *************** *** 290,294 **** ang = trajectory_angle(centre); ! b = WellSize / sqrt(distance(centre)); if (b > 1) b = 1; --- 290,300 ---- ang = trajectory_angle(centre); ! double L; ! L = distance(centre); ! if (L > 0) ! b = WellSize / sqrt(L); ! else ! b = 1.0; ! if (b > 1) b = 1; Index: shpjygst.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpjygst.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpjygst.cpp 11 Jul 2005 00:25:31 -0000 1.15 --- shpjygst.cpp 21 Jul 2005 14:55:08 -0000 1.16 *************** *** 184,188 **** void JyglarShot::inflict_damage( SpaceObject* other ){ STACKTRACE ! if( other->mass && !other->isPlanet() ){ other->accelerate( this, other->trajectory_angle( beacon ), pull / other->mass, MAX_SPEED ); } --- 184,188 ---- void JyglarShot::inflict_damage( SpaceObject* other ){ STACKTRACE ! if( other->mass > 0 && !other->isPlanet() ){ other->accelerate( this, other->trajectory_angle( beacon ), pull / other->mass, MAX_SPEED ); } Index: shpkoaja.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkoaja.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpkoaja.cpp 11 Jul 2005 00:25:32 -0000 1.7 --- shpkoaja.cpp 21 Jul 2005 14:55:08 -0000 1.8 *************** *** 263,266 **** --- 263,268 ---- if(framesOfBurn>=0) { framesOfBurn -= frame_time; + + if (mass > 0) accelerate_gravwhip (this, facingAngle, acceleration / mass, maxSpeed); } Index: shpducla.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpducla.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpducla.cpp 11 Jul 2005 00:25:30 -0000 1.15 --- shpducla.cpp 21 Jul 2005 14:55:07 -0000 1.16 *************** *** 470,482 **** tmp = dot_product(dv, _dp); tmp = ( -2 * tmp ); ! tmp = tmp * (mass * other->mass) / (mass + other->mass); if (tmp >= 0) { ! vel += _dp * tmp / mass; ! other->vel -= _dp * tmp / other->mass; } Vector2 nd; nd = unit_vector(dp); ! nd /= (mass + other->mass); while (sprite->collide(iround(p1.x), iround(p1.y), sprite_index, iround(p2.x), iround(p2.y), other->get_sprite_index(), other->get_sprite() )) { --- 470,490 ---- tmp = dot_product(dv, _dp); tmp = ( -2 * tmp ); ! ! if (mass + other->mass > 1) ! tmp = tmp * (mass * other->mass) / (mass + other->mass); ! if (tmp >= 0) { ! if (mass > 1) ! vel += _dp * tmp / mass; ! if (other->mass > 1) ! other->vel -= _dp * tmp / other->mass; } Vector2 nd; nd = unit_vector(dp); ! ! if (mass + other->mass > 1) ! nd /= (mass + other->mass); ! while (sprite->collide(iround(p1.x), iround(p1.y), sprite_index, iround(p2.x), iround(p2.y), other->get_sprite_index(), other->get_sprite() )) { Index: shpfiear.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpfiear.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** shpfiear.cpp 11 Jul 2005 00:25:31 -0000 1.12 --- shpfiear.cpp 21 Jul 2005 14:55:07 -0000 1.13 *************** *** 209,213 **** if (nv < 0) { ! if (o->mass > 0) k = o->mass / (mass*specialMassFactor); else --- 209,213 ---- if (nv < 0) { ! if (o->mass > 0 && mass > 0) k = o->mass / (mass*specialMassFactor); else Index: shpkorsi.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpkorsi.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpkorsi.cpp 11 Jul 2005 18:31:03 -0000 1.1 --- shpkorsi.cpp 21 Jul 2005 14:55:08 -0000 1.2 *************** *** 125,129 **** SidekickAngle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, this, data->spriteWeapon)); ! accelerate(this, SidekickAngle, -WEAPON_MASS / mass * weaponVelocity, MAX_SPEED); recoil += recoil_rate; --- 125,131 ---- SidekickAngle, weaponVelocity, weaponDamage, weaponRange, weaponArmour, this, data->spriteWeapon)); ! ! if (mass > 0) ! accelerate(this, SidekickAngle, -WEAPON_MASS / mass * weaponVelocity, MAX_SPEED); recoil += recoil_rate; *************** *** 201,206 **** //Vector2 v = tugger->pos-pos; if(x > 0) { ! accelerate(tugger, trajectory_angle(tugger), k*x / mass, abs(tugger->get_vel())); ! tugger->accelerate(this, tugger->trajectory_angle(this), k*x / tugger->mass, MAX_SPEED); } } --- 203,211 ---- //Vector2 v = tugger->pos-pos; if(x > 0) { ! if (mass > 0) ! accelerate(tugger, trajectory_angle(tugger), k*x / mass, abs(tugger->get_vel())); ! ! if (tugger->mass > 0) ! tugger->accelerate(this, tugger->trajectory_angle(this), k*x / tugger->mass, MAX_SPEED); } } *************** *** 277,282 **** void SidekickMissile::inflict_damage(SpaceObject* other) { ! if (other->mass) ! other->accelerate (this, this->angle, WEAPON_MASS / other->mass * abs(this->get_vel()), MAX_SPEED); Missile::inflict_damage(other); } --- 282,287 ---- void SidekickMissile::inflict_damage(SpaceObject* other) { ! if (other->mass > 0) ! other->accelerate (this, this->angle, (WEAPON_MASS / other->mass) * abs(this->get_vel()), MAX_SPEED); Missile::inflict_damage(other); } Index: shpneccr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpneccr.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** shpneccr.cpp 16 Jul 2005 23:47:23 -0000 1.15 --- shpneccr.cpp 21 Jul 2005 14:55:08 -0000 1.16 *************** *** 403,409 **** } if(isBurning==TRUE && isCoasting==FALSE) { ! if(framesOfBurn>=0) { framesOfBurn -= frame_time; ! accelerate_gravwhip (this, facingAngle, acceleration / mass, maxSpeed); } else { --- 403,412 ---- } if(isBurning==TRUE && isCoasting==FALSE) { ! if(framesOfBurn>=0) ! { framesOfBurn -= frame_time; ! ! if (mass > 0) ! accelerate_gravwhip (this, facingAngle, acceleration / mass, maxSpeed); } else { Index: shpxxxma.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpxxxma.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** shpxxxma.cpp 11 Jul 2005 00:25:32 -0000 1.18 --- shpxxxma.cpp 21 Jul 2005 14:55:08 -0000 1.19 *************** *** 392,399 **** { if (other != NULL) ! if (!sameTeam(other) && other->isShip()) other->accelerate (other, angle, weaponDartThrust / (other->mass / 20), MAX_SPEED); accelerate(this,angle+PI,weaponDartThrust / mass,MAX_SPEED); ! SeparateSpit = false; } --- 392,404 ---- { if (other != NULL) ! { ! if (!sameTeam(other) && other->isShip() && other->mass) other->accelerate (other, angle, weaponDartThrust / (other->mass / 20), MAX_SPEED); + } + + if (mass) accelerate(this,angle+PI,weaponDartThrust / mass,MAX_SPEED); ! ! SeparateSpit = false; } Index: shpgarty.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgarty.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shpgarty.cpp 21 Jul 2005 00:43:58 -0000 1.14 --- shpgarty.cpp 21 Jul 2005 14:55:08 -0000 1.15 *************** *** 202,206 **** if (q.currento->isObject()) { ! if (q.currento->mass) q.currento->accelerate (q.currento, trajectory_angle(q.currento), specialRepulse / q.currento->mass, MAX_SPEED); --- 202,206 ---- if (q.currento->isObject()) { ! if (q.currento->mass > 0) q.currento->accelerate (q.currento, trajectory_angle(q.currento), specialRepulse / q.currento->mass, MAX_SPEED); Index: shpgahmo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgahmo.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpgahmo.cpp 11 Jul 2005 00:25:31 -0000 1.8 --- shpgahmo.cpp 21 Jul 2005 14:55:07 -0000 1.9 *************** *** 613,617 **** //tractorTarget->pos = pos + unit_vector(tractorAngle) * tractorLength; tmass = mass + tractorTarget->mass; ! TM = (vel * mass + tractorTarget->vel * tractorTarget->mass)/tmass; vtransfer = (specialVelocityCouplingFactor * frame_time) / (1+(specialVelocityCouplingFactor * frame_time)); vel = vel * (1-vtransfer) + TM * vtransfer; --- 613,622 ---- //tractorTarget->pos = pos + unit_vector(tractorAngle) * tractorLength; tmass = mass + tractorTarget->mass; ! ! if (tmass > 0) ! TM = (vel * mass + tractorTarget->vel * tractorTarget->mass)/tmass; ! else ! TM = vel; ! vtransfer = (specialVelocityCouplingFactor * frame_time) / (1+(specialVelocityCouplingFactor * frame_time)); vel = vel * (1-vtransfer) + TM * vtransfer; |
From: Rob <geo...@us...> - 2005-07-21 00:44:09
|
Update of /cvsroot/timewarp/source/sc2ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29906/source/sc2ships Modified Files: shpmeltr.cpp Log Message: more control override fixes, I messed up a few pointers there... pretty sloppy of me. Index: shpmeltr.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc2ships/shpmeltr.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpmeltr.cpp 16 Jul 2005 23:46:37 -0000 1.13 --- shpmeltr.cpp 21 Jul 2005 00:43:59 -0000 1.14 *************** *** 274,278 **** { state = 0; ! ship->del_override_control(ocm); } --- 274,278 ---- { state = 0; ! //ship->del_override_control(ocm); is done later on. } |
From: Rob <geo...@us...> - 2005-07-21 00:44:09
|
Update of /cvsroot/timewarp/source/newships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29906/source/newships Modified Files: shpgarty.cpp shpiceco.cpp shptauem.cpp shptaule.cpp Log Message: more control override fixes, I messed up a few pointers there... pretty sloppy of me. Index: shpgarty.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpgarty.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpgarty.cpp 11 Jul 2005 00:25:31 -0000 1.13 --- shpgarty.cpp 21 Jul 2005 00:43:58 -0000 1.14 *************** *** 101,105 **** IDENTITY(GarashRepulsarStun); OverrideControlGarash *ocg; ! Ship *ship; int stunframe; int stunframe_count; --- 101,105 ---- IDENTITY(GarashRepulsarStun); OverrideControlGarash *ocg; ! Ship *targetship; int stunframe; int stunframe_count; *************** *** 306,310 **** : SpaceObject(oship, oship->normal_pos(), 0.0, osprite), ! ship(oship), stunframe(0), stunframe_count(stunFrames), frame_step(0), frame_size(ofsize), frame_count(ofcount) { --- 306,310 ---- : SpaceObject(oship, oship->normal_pos(), 0.0, osprite), ! targetship(oship), stunframe(0), stunframe_count(stunFrames), frame_step(0), frame_size(ofsize), frame_count(ofcount) { *************** *** 315,319 **** sprite_index = 0; ! ship->set_override_control(ocg); } --- 315,320 ---- sprite_index = 0; ! targetship = oship; ! targetship->set_override_control(ocg); } *************** *** 322,364 **** { STACKTRACE; ! if(!ship) targetIsDead = TRUE; ! else { ! if(!ship->exists()) targetIsDead = TRUE; else { ! if(ship->crew<1) targetIsDead = TRUE; ! if(ship->state==0) targetIsDead = TRUE; } } //should prevent bad pointer crashes. ! if(!targetIsDead) { ! this->pos = ship->pos; ! this->vel = ship->vel; } //may crash if target dies while the stun is in place. //targetIsDead SHOULD prevent this from happening. frame_step+= frame_time; ! while (frame_step >= frame_size) { frame_step -= frame_size; sprite_index++; if(sprite_index == frame_count) sprite_index = 0; } ! if(!(ship && ship->exists())) { ! ship = 0; state = 0; ! ship->del_override_control(ocg); ! return; } stunframe += frame_time; ! if (stunframe >= stunframe_count) state = 0; ! if(targetIsDead) this->state=0; SpaceObject::calculate(); if (!exists()) { ! ship->del_override_control(ocg); return; } --- 323,386 ---- { STACKTRACE; ! ! if(!targetship) ! { ! targetIsDead = TRUE; ! } else { ! if(!targetship->exists()) ! targetIsDead = TRUE; else { ! ! if(targetship->crew<1) ! targetIsDead = TRUE; ! ! if(targetship->state==0) ! targetIsDead = TRUE; ! } } + //should prevent bad pointer crashes. ! if(!targetIsDead) ! { ! this->pos = targetship->pos; ! this->vel = targetship->vel; } + //may crash if target dies while the stun is in place. //targetIsDead SHOULD prevent this from happening. frame_step+= frame_time; ! ! while (frame_step >= frame_size) ! { frame_step -= frame_size; sprite_index++; + if(sprite_index == frame_count) sprite_index = 0; } ! ! if(!(targetship && targetship->exists())) { ! //targetship = 0; no, we need this one more time. state = 0; ! //targetship->del_override_control(ocg); ! //return; } stunframe += frame_time; ! ! if (stunframe >= stunframe_count) ! state = 0; ! ! if(targetIsDead) ! state = 0; ! SpaceObject::calculate(); if (!exists()) { ! targetship->del_override_control(ocg); return; } Index: shptaule.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptaule.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** shptaule.cpp 16 Jul 2005 23:46:37 -0000 1.17 --- shptaule.cpp 21 Jul 2005 00:43:59 -0000 1.18 *************** *** 587,590 **** --- 587,591 ---- victim->del_override_control(ocl); victim = 0; + state = 0; return; } Index: shptauem.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shptauem.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** shptauem.cpp 11 Jul 2005 00:25:32 -0000 1.14 --- shptauem.cpp 21 Jul 2005 00:43:59 -0000 1.15 *************** *** 299,303 **** { state = 0; ! jamtarget = 0; } --- 299,303 ---- { state = 0; ! //jamtarget = 0; no, we need this once more. } Index: shpiceco.cpp =================================================================== RCS file: /cvsroot/timewarp/source/newships/shpiceco.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpiceco.cpp 11 Jul 2005 00:25:31 -0000 1.13 --- shpiceco.cpp 21 Jul 2005 00:43:59 -0000 1.14 *************** *** 233,239 **** if ( !(t && t->exists()) ) { ! t = 0; state = 0; ! return; } --- 233,239 ---- if ( !(t && t->exists()) ) { ! //t = 0; no, we need this once more state = 0; ! //return; } *************** *** 241,246 **** { state = 0; ! t->del_override_control(oci); ! return; } --- 241,246 ---- { state = 0; ! //t->del_override_control(oci); ! //return; } |
From: Rob <geo...@us...> - 2005-07-21 00:24:40
|
Update of /cvsroot/timewarp/source/sc3ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25892/source/sc3ships Modified Files: shpowavo.cpp shpxchex.cpp Log Message: fixing override-control bug Index: shpowavo.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpowavo.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpowavo.cpp 11 Jul 2005 00:25:59 -0000 1.11 --- shpowavo.cpp 21 Jul 2005 00:24:30 -0000 1.12 *************** *** 7,10 **** --- 7,19 ---- #define OWADISABLE_SPEC 0x36 + + // allows other ships to affect control over a ship. + class OverrideControlOwa : public OverrideControl + { + public: + virtual void calculate(short *key); + }; + + class OwaVoyager : public Ship { public: *************** *** 100,104 **** class OwaDisable : public SpaceObject { public: ! IDENTITY(OwaDisable); int disableframe; int disableframe_count; --- 109,115 ---- class OwaDisable : public SpaceObject { public: ! IDENTITY(OwaDisable); ! Ship *targetship; ! OverrideControlOwa *oco; int disableframe; int disableframe_count; *************** *** 238,241 **** --- 249,262 ---- } + + + void OverrideControlOwa::calculate(short *key) + { + *key &= ~(keyflag::left | keyflag::right | keyflag::thrust); + } + + + + OwaDisable::OwaDisable(Ship *otarget, OwaSpecial *ocreator, SpaceSprite *osprite, int ofcount, int ofsize, int disableFrames,int lowerFrames) : *************** *** 249,261 **** --- 270,297 ---- { target = otarget; + + if ( target->isShip() ) + targetship = (Ship*) target; + else + targetship = 0; + id = OWADISABLE_SPEC; sprite_index = lowerFrames; collide_flag_anyone = 0; layer = LAYER_SPECIAL; + + if (targetship) + { + oco = new OverrideControlOwa(); + targetship->set_override_control(oco); + } else + oco = 0; } + void OwaDisable::target_died() { state = 0; return; } + void OwaDisable::calculate() { *************** *** 263,267 **** { state = 0; - return; } --- 299,302 ---- *************** *** 273,289 **** sprite_index = lowerindex; } 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; ! SpaceObject::calculate(); ! return; } Ship *OwaDisable::return_disable() { --- 308,339 ---- sprite_index = lowerindex; } + 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; ! } ! ! if (!exists() || !(target && targetship->exists()) ) ! { ! if (targetship) ! targetship->del_override_control(oco); } + // the following can set target=0, so must be done last + SpaceObject::calculate(); + + } + Ship *OwaDisable::return_disable() { *************** *** 304,328 **** void OwaSpecial::animateExplosion() {} ! void OwaSpecial::inflict_damage(SpaceObject *other) { ! if (other->isShip()) { ! play_sound(data->sampleExtra[0]); ! SpaceObject *o = NULL; ! Query a; ! int found = FALSE; ! for (a.begin(this, ALL_LAYERS ,distance(other)+ 10); ! a.current; a.next()) { ! o = a.currento; ! if ((o->getID()) == OWADISABLE_SPEC) ! if ((((OwaDisable *)o)->return_disable()) == other) { ! ((OwaDisable *)o)->reset_time(); ! found = TRUE; ! } ! if (!found) { ! add(new OwaDisable( ! (Ship *)(other), this, data->spriteExtraExplosion, 32, 40, disableFrames, 0)); ! add(new OwaDisable( ! (Ship *)(other), this, data->spriteExtraExplosion, 32, 40, disableFrames, 32)); ! } } } ! state = 0; return; } --- 354,393 ---- void OwaSpecial::animateExplosion() {} ! void OwaSpecial::inflict_damage(SpaceObject *other) ! { ! if (other->isShip()) { ! play_sound(data->sampleExtra[0]); ! ! /* ! SpaceObject *o = NULL; ! Query a; ! int found = FALSE; ! for (a.begin(this, ALL_LAYERS ,distance(other)+ 10); ! a.current; a.next()) ! { ! o = a.currento; ! if ((o->getID()) == OWADISABLE_SPEC) ! { ! if ((((OwaDisable *)o)->return_disable()) == other) ! { ! ((OwaDisable *)o)->reset_time(); ! found = TRUE; ! } ! } ! ! if (!found) ! { ! add(new OwaDisable( ! (Ship *)(other), this, data->spriteExtraExplosion, 32, 40, disableFrames, 0)); ! add(new OwaDisable( ! (Ship *)(other), this, data->spriteExtraExplosion, 32, 40, disableFrames, 32)); ! } ! } ! */ ! ! add(new OwaDisable( ! (Ship *)(other), this, data->spriteExtraExplosion, 32, 40, disableFrames, 32)); ! } ! state = 0; return; } Index: shpxchex.cpp =================================================================== RCS file: /cvsroot/timewarp/source/sc3ships/shpxchex.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** shpxchex.cpp 11 Jul 2005 00:25:59 -0000 1.13 --- shpxchex.cpp 21 Jul 2005 00:24:31 -0000 1.14 *************** *** 145,155 **** void XchaggerDisable::calculate() { ! if (!(ship && ship->exists())) { state = 0; - return; } ! frame_step+= frame_time; while (frame_step >= frame_size) { --- 145,154 ---- void XchaggerDisable::calculate() { ! if (!(ship && ship->exists())) { state = 0; } ! frame_step+= frame_time; while (frame_step >= frame_size) { *************** *** 158,195 **** if(sprite_index == (lowerindex + frame_count)) sprite_index = lowerindex; ! } if(!(ship && ship->exists())) { ship = 0; // should be here cause you return before the other call state = 0; ! return; ! } if(!(target && target->exists() && target->isShip())) { target = 0; state = 0; ! affectship->del_override_control(ocx); ! return; ! } ! ! Ship *t = (Ship*)target; ! if (!lowerindex) { ! pos = t->normal_pos(); ! } ! else { ! pos = t->normal_pos() + (frame_time * t->get_vel()); ! SpaceObject::calculate(); ! } ! disableframe += frame_time; ! if (disableframe >= disableframe_count) { ! affectship->del_override_control(ocx); ! state = 0; } if (!exists()) { ! affectship->del_override_control(ocx); } - return; } --- 157,194 ---- if(sprite_index == (lowerindex + frame_count)) sprite_index = lowerindex; ! } if(!(ship && ship->exists())) { ship = 0; // should be here cause you return before the other call state = 0; ! } if(!(target && target->exists() && target->isShip())) { target = 0; state = 0; ! } ! if (target) { ! Ship *t = (Ship*)target; ! ! if (!lowerindex) { ! pos = t->normal_pos(); ! } ! else { ! pos = t->normal_pos() + (frame_time * t->get_vel()); ! SpaceObject::calculate(); ! } ! disableframe += frame_time; ! if (disableframe >= disableframe_count) ! { ! state = 0; ! } } + // 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); } } |
From: Rob <geo...@us...> - 2005-07-20 12:49:27
|
Update of /cvsroot/timewarp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17436 Modified Files: gflmelee.ini Log Message: katas replaced by katpo, cause katas is no longer in the distribution Index: gflmelee.ini =================================================================== RCS file: /cvsroot/timewarp/gflmelee.ini,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gflmelee.ini 11 Jul 2005 00:25:01 -0000 1.11 --- gflmelee.ini 20 Jul 2005 12:48:56 -0000 1.12 *************** *** 143,147 **** ship01 = glads ship02 = strsc ! ship03 = katas ship04 = ktesa ship05 = montr --- 143,147 ---- ship01 = glads ship02 = strsc ! ship03 = katpo ship04 = ktesa ship05 = montr |
From: Rob <geo...@us...> - 2005-07-19 00:03:03
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18060/ships Modified Files: shpclofl.ini shpgerhe.ini shpglacr.ini shpkorsi.ini shpkorsn.ini shpnarlu.ini shpneodr.ini shpplala.ini shpradfi.ini shptougr.ini shpxilcr.ini Log Message: slight changes in point-value; (imo) more reasonable values for these ships. Index: shpclofl.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpclofl.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpclofl.ini 15 Jul 2005 18:38:27 -0000 1.5 --- shpclofl.ini 19 Jul 2005 00:02:53 -0000 1.6 *************** *** 75,78 **** NumNames = 2 CaptName1 = Eelof-Veeras ! CaptName2 = Ure-Murni --- 75,78 ---- NumNames = 2 CaptName1 = Eelof-Veeras ! CaptName2 = Uree-Muurni Index: shpplala.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpplala.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpplala.ini 8 Jan 2004 22:21:42 -0000 1.1 --- shpplala.ini 19 Jul 2005 00:02:53 -0000 1.2 *************** *** 1,4 **** [Info] ! TWCost = 21 Name1 = Planet Name2 = Lander --- 1,4 ---- [Info] ! TWCost = 1 Name1 = Planet Name2 = Lander Index: shpradfi.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpradfi.ini,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shpradfi.ini 15 Jul 2005 19:12:13 -0000 1.7 --- shpradfi.ini 19 Jul 2005 00:02:53 -0000 1.8 *************** *** 1,4 **** [Info] ! TWCost = 14 Name1 = Radean Name2 = Firestorm --- 1,4 ---- [Info] ! TWCost = 9 Name1 = Radean Name2 = Firestorm Index: shpneodr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpneodr.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpneodr.ini 11 Jul 2005 00:25:09 -0000 1.5 --- shpneodr.ini 19 Jul 2005 00:02:53 -0000 1.6 *************** *** 1,5 **** [Info] ! TWCost = 8 Name1 = Neo Name2 = Drain --- 1,5 ---- [Info] ! TWCost = 9 Name1 = Neo Name2 = Drain Index: shptougr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shptougr.ini,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** shptougr.ini 15 Jul 2005 19:12:13 -0000 1.7 --- shptougr.ini 19 Jul 2005 00:02:53 -0000 1.8 *************** *** 1,4 **** [Info] ! TWCost = 16 Name1 = To'Ul Name2 = Rockblaster --- 1,4 ---- [Info] ! TWCost = 15 Name1 = To'Ul Name2 = Rockblaster Index: shpglacr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpglacr.ini,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** shpglacr.ini 15 Jul 2005 18:38:27 -0000 1.8 --- shpglacr.ini 19 Jul 2005 00:02:53 -0000 1.9 *************** *** 1,6 **** [Info] ! SC1Cost = 19 ! SC2Cost = 19 ! TWCost = 19 Name1 = Gla'vria Name2 = Cruiser --- 1,6 ---- [Info] ! SC1Cost = 17 ! SC2Cost = 17 ! TWCost = 17 Name1 = Gla'vria Name2 = Cruiser Index: shpnarlu.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpnarlu.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpnarlu.ini 5 Jan 2004 21:59:54 -0000 1.6 --- shpnarlu.ini 19 Jul 2005 00:02:53 -0000 1.7 *************** *** 1,4 **** [Info] ! TWCost = 25 Name1 = Narool Name2 = Lurker --- 1,4 ---- [Info] ! TWCost = 28 Name1 = Narool Name2 = Lurker Index: shpkorsi.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpkorsi.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpkorsi.ini 11 Jul 2005 17:04:18 -0000 1.1 --- shpkorsi.ini 19 Jul 2005 00:02:53 -0000 1.2 *************** *** 1,6 **** [Info] Origin = TWb ! SC2Cost = 10 ! TWCost = 30 Name1 = Korvian Name2 = Sidekick --- 1,5 ---- [Info] Origin = TWb ! TWCost = 12 Name1 = Korvian Name2 = Sidekick Index: shpgerhe.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpgerhe.ini,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** shpgerhe.ini 5 Jan 2004 21:59:54 -0000 1.6 --- shpgerhe.ini 19 Jul 2005 00:02:53 -0000 1.7 *************** *** 1,4 **** [Info] ! TWCost = 14 Name1 = Gerl Name2 = Hero --- 1,4 ---- [Info] ! TWCost = 9 Name1 = Gerl Name2 = Hero Index: shpxilcr.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpxilcr.ini,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** shpxilcr.ini 15 Jul 2005 19:12:13 -0000 1.11 --- shpxilcr.ini 19 Jul 2005 00:02:53 -0000 1.12 *************** *** 1,4 **** [Info] ! TWCost = 14 Name1 = Xillz Name2 = Crescent --- 1,4 ---- [Info] ! TWCost = 11 Name1 = Xillz Name2 = Crescent Index: shpkorsn.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpkorsn.ini,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** shpkorsn.ini 11 Jul 2005 17:04:18 -0000 1.1 --- shpkorsn.ini 19 Jul 2005 00:02:53 -0000 1.2 *************** *** 1,6 **** [Info] Origin = TWb - SC1Cost = 10 - SC2Cost = 10 TWCost = 30 Name1 = Korvian --- 1,4 ---- |
From: Rob <geo...@us...> - 2005-07-17 22:39:37
|
Update of /cvsroot/timewarp/ships In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9489/ships Modified Files: shpearc2.ini Log Message: increased the cost, cause it's an ubership. Index: shpearc2.ini =================================================================== RCS file: /cvsroot/timewarp/ships/shpearc2.ini,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** shpearc2.ini 15 Jul 2005 16:23:26 -0000 1.5 --- shpearc2.ini 17 Jul 2005 22:39:28 -0000 1.6 *************** *** 1,4 **** [Info] ! TWCost = 19 Name1 = Earthling Name2 = Crusader --- 1,4 ---- [Info] ! TWCost = 30 Name1 = Earthling Name2 = Crusader *************** *** 11,16 **** Crew = 16 CrewMax = 16 ! Batt = 24 ! BattMax = 24 SpeedMax = 35 AccelRate = 6 --- 11,16 ---- Crew = 16 CrewMax = 16 ! Batt = 22 ! BattMax = 22 SpeedMax = 35 AccelRate = 6 |