diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/engine/server/server.cpp | 2 | ||||
| -rw-r--r-- | src/game/client/game_client.cpp | 37 | ||||
| -rw-r--r-- | src/game/game_variables.h | 2 | ||||
| -rw-r--r-- | src/game/server/game_server.cpp | 18 |
4 files changed, 29 insertions, 30 deletions
diff --git a/src/engine/server/server.cpp b/src/engine/server/server.cpp index 77a32962..71fb9b94 100644 --- a/src/engine/server/server.cpp +++ b/src/engine/server/server.cpp @@ -249,7 +249,7 @@ public: reporttime += time_freq()*reportinterval; } totaltime += time_get()-t; - //thread_sleep(1); + thread_sleep(1); } mods_shutdown(); diff --git a/src/game/client/game_client.cpp b/src/game/client/game_client.cpp index 7b5b69c4..7f751f51 100644 --- a/src/game/client/game_client.cpp +++ b/src/game/client/game_client.cpp @@ -1003,21 +1003,22 @@ void ingamemenu_render() { if (!local_player) return; - gfx_mapscreen(0, 0, 800, 600); + gfx_mapscreen(0, 0, 800, 600); // TODO: fix me // Ingame menu - quit and change team (if tdm) float mx,my; int rx, ry; inp_mouse_relative(&rx, &ry); - mouse_pos.x += rx; - mouse_pos.y += ry; - if(mouse_pos.x < 0) mouse_pos.x = 0; - if(mouse_pos.y < 0) mouse_pos.y = 0; - if(mouse_pos.x > gfx_screenwidth()) mouse_pos.x = gfx_screenwidth(); - if(mouse_pos.y > gfx_screenheight()) mouse_pos.y = gfx_screenheight(); + static vec2 menu_mouse_pos(0,0); + menu_mouse_pos.x += rx; + menu_mouse_pos.y += ry; + if(menu_mouse_pos.x < 0) mouse_pos.x = 0; + if(menu_mouse_pos.y < 0) mouse_pos.y = 0; + if(menu_mouse_pos.x > gfx_screenwidth()) menu_mouse_pos.x = gfx_screenwidth(); + if(menu_mouse_pos.y > gfx_screenheight()) menu_mouse_pos.y = gfx_screenheight(); // update the ui - mx = (mouse_pos.x/(float)gfx_screenwidth())*800.0f; - my = (mouse_pos.y/(float)gfx_screenheight())*600.0f; + mx = (menu_mouse_pos.x/(float)gfx_screenwidth())*800.0f; + my = (menu_mouse_pos.y/(float)gfx_screenheight())*600.0f; int buttons = 0; if(inp_key_pressed(input::mouse_1)) buttons |= 1; @@ -1026,12 +1027,6 @@ void ingamemenu_render() ui_update(mx,my,mx*3.0f,my*3.0f,buttons); - gfx_texture_set(cursor_texture); - gfx_quads_begin(); - gfx_quads_setcolor(1,1,1,1); - gfx_quads_drawTL(mx,my,24,24); - gfx_quads_end(); - char buf[128]; if (gametype == GAMETYPE_TDM) { @@ -1047,11 +1042,18 @@ void ingamemenu_render() } } - if (ui_do_button(&menu_quit, "Quit", 0, 30, 350, 170, 48, draw_teewars_button)) + if (ui_do_button(&menu_quit, "Disconnect", 0, 30, 350, 170, 48, draw_teewars_button)) { //if (get_state() == STATE_CONNECTING || get_state() == STATE_ONLINE) main_client.disconnect(); } + + gfx_texture_set(cursor_texture); + gfx_quads_begin(); + gfx_quads_setcolor(1,1,1,1); + gfx_quads_drawTL(mx,my,24,24); + gfx_quads_end(); + } void modc_render() @@ -1115,6 +1117,7 @@ void modc_render() input::clear_key(); // TODO: bypasses the engine interface // fetch new input + if(!menu_active) { int x, y; inp_mouse_relative(&x, &y); @@ -1585,7 +1588,7 @@ void modc_render() sprintf(buf, "%4d", player->latency); float tw = gfx_pretty_text_width(48.0f, buf); - gfx_pretty_text(offsetx + x + 220, y, 48, buf); + gfx_pretty_text(offsetx + x + 240, y, 48, buf); offsets[player->team] += 58.0f; } diff --git a/src/game/game_variables.h b/src/game/game_variables.h index 04deceb6..8775074e 100644 --- a/src/game/game_variables.h +++ b/src/game/game_variables.h @@ -4,5 +4,5 @@ MACRO_CONFIG_INT(key_jump, 32, 32, 512) MACRO_CONFIG_INT(key_fire, 384, 32, 512) MACRO_CONFIG_INT(key_hook, 385, 32, 512) -MACRO_CONFIG_INT(scorelimit, 2, 0, 1000) +MACRO_CONFIG_INT(scorelimit, 20, 0, 1000) MACRO_CONFIG_INT(timelimit, 0, 0, 1000) diff --git a/src/game/server/game_server.cpp b/src/game/server/game_server.cpp index a1f1b72e..fc8718fb 100644 --- a/src/game/server/game_server.cpp +++ b/src/game/server/game_server.cpp @@ -343,7 +343,7 @@ game_world world; gameobject::gameobject() : entity(OBJTYPE_GAME) { - gametype = GAMETYPE_DM; + gametype = GAMETYPE_TDM; game_over_tick = -1; sudden_death = 0; round_start_tick = server_tick(); @@ -703,10 +703,6 @@ void player::respawn() weapons[WEAPON_GUN].got = true; weapons[WEAPON_GUN].ammo = data->weapons[active_weapon].maxammo; - // TEMP DEBUG - weapons[WEAPON_ROCKET_BACKPACK].got = true; - weapons[WEAPON_ROCKET_BACKPACK].ammo = 10; - active_weapon = WEAPON_GUN; reload_timer = 0; @@ -1006,7 +1002,7 @@ void player::tick() // TODO: remove this tick count, it feels weird if(dead) { - if(server_tick()-die_tick >= server_tickspeed()*3) // auto respawn after 3 sec + if(server_tick()-die_tick >= server_tickspeed()*5) // auto respawn after 3 sec respawn(); if(input.fire && server_tick()-die_tick >= server_tickspeed()/2) // auto respawn after 0.5 sec respawn(); @@ -1376,14 +1372,14 @@ void powerup::tick() if(pplayer->health < data->playerinfo[gameobj.gametype].maxhealth) { pplayer->health = min((int)data->playerinfo[gameobj.gametype].maxhealth, pplayer->health + 1); - respawntime = 20; + respawntime = 15; } break; case POWERUP_TYPE_ARMOR: if(pplayer->armor < data->playerinfo[gameobj.gametype].maxarmor) { pplayer->armor = min((int)data->playerinfo[gameobj.gametype].maxarmor, pplayer->armor + 1); - respawntime = 20; + respawntime = 15; } break; @@ -1393,8 +1389,8 @@ void powerup::tick() if(pplayer->weapons[subtype].ammo < 10 || !pplayer->weapons[subtype].got) { pplayer->weapons[subtype].got = true; - pplayer->weapons[subtype].ammo = min(10, pplayer->weapons[subtype].ammo + 5); - respawntime = 20; + pplayer->weapons[subtype].ammo = min(10, pplayer->weapons[subtype].ammo + 10); + respawntime = 15; } } break; @@ -1404,7 +1400,7 @@ void powerup::tick() pplayer->ninjaactivationtick = server_tick(); pplayer->weapons[WEAPON_NINJA].got = true; pplayer->active_weapon = WEAPON_NINJA; - respawntime = 20; + respawntime = 90; break; } default: |