diff --git a/polymer/eduke32/source/funct.h b/polymer/eduke32/source/funct.h index e6090ed3e..9ae646dc1 100644 --- a/polymer/eduke32/source/funct.h +++ b/polymer/eduke32/source/funct.h @@ -242,5 +242,6 @@ extern void sendquit(void); extern void adduserquote(char *daquote); extern char *stripcolorcodes(char *t); +extern void mpchangemap(char volume, char level); #endif // __funct_h__ diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index ceec1dd14..ee030def0 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -7482,23 +7482,7 @@ FOUNDCHEAT: ud.m_player_skill = ud.player_skill = cheatbuf[i] - '1'; } if (numplayers > 1 && myconnectindex == connecthead) - { - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number; - tempbuf[2] = ud.m_volume_number; - tempbuf[3] = ud.m_player_skill; - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - tempbuf[11] = ud.m_noexits; - - for (i=connecthead;i>=0;i=connectpoint2[i]) - sendpacket(i,tempbuf,12); - } + mpchangemap(ud.m_volume_number,ud.m_level_number); else ps[myconnectindex].gm |= MODE_RESTART; ps[myconnectindex].cheat_phase = 0; @@ -9511,6 +9495,30 @@ void sendboardname(void) } } +void mpchangemap(char volume, char level) +{ + int i; + + tempbuf[0] = 5; + tempbuf[1] = ud.m_level_number = level; + tempbuf[2] = ud.m_volume_number = volume; + tempbuf[3] = ud.m_player_skill+1; + tempbuf[4] = ud.m_monsters_off; + tempbuf[5] = ud.m_respawn_monsters; + tempbuf[6] = ud.m_respawn_items; + tempbuf[7] = ud.m_respawn_inventory; + tempbuf[8] = ud.m_coop; + tempbuf[9] = ud.m_marker; + tempbuf[10] = ud.m_ffire; + tempbuf[11] = ud.m_noexits; + + for (i=connecthead;i>=0;i=connectpoint2[i]) + { + if (i != myconnectindex) sendpacket(i,tempbuf,12); + if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master + } +} + static void getnames(void) { int l; diff --git a/polymer/eduke32/source/gameexec.c b/polymer/eduke32/source/gameexec.c index 40738dc6f..84329ac9d 100644 --- a/polymer/eduke32/source/gameexec.c +++ b/polymer/eduke32/source/gameexec.c @@ -4475,26 +4475,7 @@ SKIPJIBS: ud.m_volume_number = ud.volume_number = volnume; ud.m_level_number = ud.level_number = levnume; if (numplayers > 1 && myconnectindex == connecthead) - { - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number; - tempbuf[2] = ud.m_volume_number; - tempbuf[3] = ud.m_player_skill; - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - tempbuf[11] = ud.m_noexits; - - for (i=connecthead;i>=0;i=connectpoint2[i]) - { - if (i != myconnectindex) sendpacket(i,tempbuf,12); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master - } - } + mpchangemap(volnume,levnume); else { ps[myconnectindex].gm |= MODE_EOL; diff --git a/polymer/eduke32/source/menus.c b/polymer/eduke32/source/menus.c index 5b3970df0..7d0710dfb 100644 --- a/polymer/eduke32/source/menus.c +++ b/polymer/eduke32/source/menus.c @@ -4498,11 +4498,6 @@ VOLUME_ALL_40x: { if (plrvotes > (numplayers>>1) || !ps[myconnectindex].i || (!networkmode && myconnectindex == connecthead)) { - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number; - tempbuf[2] = ud.m_volume_number; - tempbuf[3] = ud.m_player_skill+1; - if (ud.m_player_skill == 3) ud.m_respawn_monsters = 1; else ud.m_respawn_monsters = 0; @@ -4511,27 +4506,15 @@ VOLUME_ALL_40x: ud.m_respawn_inventory = 1; - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - tempbuf[11] = ud.m_noexits; - for (c=connecthead;c>=0;c=connectpoint2[c]) { resetweapons(c); resetinventory(c); } - for (c=connecthead;c>=0;c=connectpoint2[c]) - { - if (c != myconnectindex) sendpacket(c,tempbuf,12); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master - } - + + mpchangemap(ud.m_volume_number,ud.m_level_number); + if (voting == myconnectindex) adduserquote("VOTE SUCCEEDED"); diff --git a/polymer/eduke32/source/osdcmds.c b/polymer/eduke32/source/osdcmds.c index 408d7dec3..39b771c2b 100644 --- a/polymer/eduke32/source/osdcmds.c +++ b/polymer/eduke32/source/osdcmds.c @@ -101,28 +101,7 @@ int osdcmd_changelevel(const osdfuncparm_t *parm) if (numplayers > 1) { if (myconnectindex == connecthead && networkmode == 0) - { - int i; - - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number = level; - tempbuf[2] = ud.m_volume_number = volume; - tempbuf[3] = ud.m_player_skill; - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - tempbuf[11] = ud.m_noexits; - - for (i=connecthead;i>=0;i=connectpoint2[i]) - { - if (i != myconnectindex) sendpacket(i,tempbuf,12); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master - } - } + mpchangemap(volume,level); else if (voting == -1) { ud.m_volume_number = volume; @@ -221,25 +200,7 @@ int osdcmd_map(const osdfuncparm_t *parm) if (myconnectindex == connecthead && networkmode == 0) { sendboardname(); - - tempbuf[0] = 5; - tempbuf[1] = ud.m_level_number = 7; - tempbuf[2] = ud.m_volume_number = 0; - tempbuf[3] = ud.m_player_skill; - tempbuf[4] = ud.m_monsters_off; - tempbuf[5] = ud.m_respawn_monsters; - tempbuf[6] = ud.m_respawn_items; - tempbuf[7] = ud.m_respawn_inventory; - tempbuf[8] = ud.m_coop; - tempbuf[9] = ud.m_marker; - tempbuf[10] = ud.m_ffire; - tempbuf[11] = ud.m_noexits; - - for (i=connecthead;i>=0;i=connectpoint2[i]) - { - if (i != myconnectindex) sendpacket(i,tempbuf,12); - if ((!networkmode) && (myconnectindex != connecthead)) break; //slaves in M/S mode only send to master - } + mpchangemap(0,7); } else if (voting == -1) {