From 7fb2e98281cd7c639c760a2953835cb012560807 Mon Sep 17 00:00:00 2001 From: cypress Date: Sat, 6 Jan 2024 21:43:23 -0500 Subject: [PATCH] FTE/SERVER: Minor Waypoint cleanup, allow non-solid func_door --- source/server/ai/fte/waypoints_core.qc | 36 +------------------ source/server/main.qc | 50 +++++++++++--------------- source/server/weapons/weapon_core.qc | 16 --------- 3 files changed, 21 insertions(+), 81 deletions(-) diff --git a/source/server/ai/fte/waypoints_core.qc b/source/server/ai/fte/waypoints_core.qc index d2586fc..8735492 100644 --- a/source/server/ai/fte/waypoints_core.qc +++ b/source/server/ai/fte/waypoints_core.qc @@ -862,40 +862,6 @@ void () Waypoint_Functions = void () Waypoint_Logic = { - if (!waypoint_mode) { - waypoint_mode = 1; - entity zent; - - zent = find (world, classname, "ai_zombie"); - while (zent) - { - remove (zent); - zent = find (zent, classname, "ai_zombie"); - } - - zent = find (world, classname, "door_nzp_cost"); - while (zent) - { - zent.solid = SOLID_NOT; - zent.touch = SUB_Null; - zent = find (zent, classname, "door_nzp_cost"); - } - zent = find (world, classname, "door_nzp"); - while (zent) - { - zent.solid = SOLID_NOT; - zent.touch = SUB_Null; - zent.solid = SOLID_NOT; - zent = find (zent, classname, "door_nzp"); - } - zent = find (world, classname, "window"); - while (zent) - { - zent.solid = SOLID_NOT; - zent.touch = SUB_Null; - zent = find (zent, classname, "window"); - } - - } + waypoint_mode = true; Waypoint_Functions(); }; \ No newline at end of file diff --git a/source/server/main.qc b/source/server/main.qc index 832f9ad..007b70a 100644 --- a/source/server/main.qc +++ b/source/server/main.qc @@ -39,6 +39,23 @@ void() main = float ai_delay_time; +// +// Way_SetBrushEntNonSolid(ent_name) +// FIXME: Move this elsewhere.. +// Wrapper for finding brush ents of classname +// and making them non-solid. For use only +// with Waypoint Mode. +// +void(string ent_name) Way_SetBrushEntNonSolid = +{ + entity ent = find(world, classname, ent_name); + while(ent != world) { + ent.solid = SOLID_NOT; + ent.touch = SUB_Null; + ent = find(ent, classname, ent_name); + } +} + //called for each frame that QC runs float zombie_cleaned_w; void() StartFrame = @@ -51,14 +68,6 @@ void() StartFrame = zent = find (world, classname, "ai_zombie"); while (zent) { - /* - if (zent.head) - remove (zent.head); - if (zent.larm) - remove (zent.larm); - if (zent.rarm) - remove (zent.rarm); - */ remove (zent); zent = find (zent, classname, "ai_zombie"); } @@ -73,28 +82,9 @@ void() StartFrame = setmodel(zent, "models/way/normal_way.spr"); zent = find (zent, classname, "waypoint"); } - zent = find (world, classname, "door_nzp_cost"); - while (zent) - { - zent.solid = SOLID_NOT; - zent.touch = SUB_Null; - zent = find (zent, classname, "door_nzp_cost"); - } - zent = find (world, classname, "door_nzp"); - while (zent) - { - zent.solid = SOLID_NOT; - zent.touch = SUB_Null; - zent.solid = SOLID_NOT; - zent = find (zent, classname, "door_nzp"); - } - zent = find (world, classname, "window"); - while (zent) - { - zent.solid = SOLID_NOT; - zent.touch = SUB_Null; - zent = find (zent, classname, "window"); - } + Way_SetBrushEntNonSolid("door_nzp_cost"); + Way_SetBrushEntNonSolid("door_nzp"); + Way_SetBrushEntNonSolid("door"); } return; } diff --git a/source/server/weapons/weapon_core.qc b/source/server/weapons/weapon_core.qc index b5b92da..bedde92 100644 --- a/source/server/weapons/weapon_core.qc +++ b/source/server/weapons/weapon_core.qc @@ -1697,22 +1697,6 @@ void () Impulse_Functions = break; case 100: cvar_set("waypoint_mode", "1"); - - local entity d; - d = find(world,classname,"door_nzp_cost"); - while(d != world) - { - d.classname = "door_nzp"; - d = find(d,classname,"door_nzp_cost"); - } - d = find(world,classname,"door_open"); - while(d != world) - { - d.classname = "door_nzp"; - d = find(d,classname,"door_open"); - } - - waypoint_mode = 1; localcmd("restart\n"); break; default: