diff --git a/base/src/server/items.qc b/base/src/server/items.qc index 43b5a48f..52a104d2 100644 --- a/base/src/server/items.qc +++ b/base/src/server/items.qc @@ -70,7 +70,7 @@ item_pickup::Respawn(void) think = __NULL__; nextthink = -1; - if (!m_iWasDropped && cvar("sv_playerslots") > 1) { + if (!m_iWasDropped) { m_iClip = -1; } diff --git a/src/client/entry.qc b/src/client/entry.qc index 6d4bd93c..18d9aa5f 100644 --- a/src/client/entry.qc +++ b/src/client/entry.qc @@ -492,7 +492,10 @@ CSQC_InputEvent(float fEventType, float fKey, float fCharacter, float fDeviceID) setcursormode(FALSE, "gfx/cursor", [0,0,0], 1.0f); } - return (0); + if (VGUI_Active()) + return (1); + else + return (0); } /* @@ -508,7 +511,7 @@ CSQC_Input_Frame(void) CSQC_UpdateSeat(); /* If we are inside a VGUI, don't let the client do stuff outside */ - if (g_vguiWidgetCount > 0) { + if (VGUI_Active()) { input_impulse = 0; input_buttons = 0; return; diff --git a/src/gs-entbase/server/func_breakable.qc b/src/gs-entbase/server/func_breakable.qc index 622f96b5..b4a5156d 100644 --- a/src/gs-entbase/server/func_breakable.qc +++ b/src/gs-entbase/server/func_breakable.qc @@ -316,18 +316,15 @@ func_breakable::Respawn(void) } /* initially set the health to that of the ent-data */ - health = GetSpawnHealth(); + float sh = GetSpawnHealth(); - if (HasPropData() == TRUE) { + if (HasPropData() == TRUE && sh == 0) { /* assign propdata health */ health = GetPropData(PROPINFO_HEALTH); - - /* didn't supply valid health */ - if (health <= 0) - health = GetSpawnHealth(); - m_flExplodeMag = GetPropData(PROPINFO_EXPLOSIVE_DMG); m_flExplodeRad = GetPropData(PROPINFO_EXPLOSIVE_RADIUS); + } else { + health = sh; } /* unassigned health isn't valid */ diff --git a/src/gs-entbase/shared/NSMonster.h b/src/gs-entbase/shared/NSMonster.h index e4c5ca69..f55d949d 100644 --- a/src/gs-entbase/shared/NSMonster.h +++ b/src/gs-entbase/shared/NSMonster.h @@ -283,4 +283,6 @@ class NSMonster:NSSurfacePropEntity #ifdef CLIENT string Sentences_GetSamples(string); string Sentences_ProcessSample(string); +#else +void NSMonster_AlertEnemyAlliance(vector pos, float radius, int alliance); #endif \ No newline at end of file diff --git a/src/gs-entbase/shared/NSMonster.qc b/src/gs-entbase/shared/NSMonster.qc index c1f27af6..4223f96b 100644 --- a/src/gs-entbase/shared/NSMonster.qc +++ b/src/gs-entbase/shared/NSMonster.qc @@ -993,4 +993,36 @@ NSMonster_ReadEntity(float new) } me.ReceiveEntity(new, readfloat()); } +#else +void +NSMonster_AlertEnemyAlliance(vector pos, float radius, int alliance) +{ + for (entity w = world; (w = findfloat(w, ::takedamage, DAMAGE_YES));) { + /* out of radius */ + if (vlen(pos - w.origin) > radius) + continue; + + /* only target monsters */ + if (!(w.flags & FL_MONSTER)) + continue; + + NSMonster f = (NSMonster)w; + + /* they already got a target of some kind */ + if (f.m_eEnemy) + continue; + + /* if they're our friend... ignore*/ + if (f.IsFriend(alliance)) + continue; + /* if the monster is dead... ignore */ + if (f.health <= 0) + continue; + + /* we've heard a noise. investigate the location */ + f.ClearRoute(); + f.NewRoute(pos); + f.m_flSequenceSpeed = 140; + } +} #endif diff --git a/src/gs-entbase/shared/NSSurfacePropEntity.qc b/src/gs-entbase/shared/NSSurfacePropEntity.qc index 20282628..fd12b40e 100644 --- a/src/gs-entbase/shared/NSSurfacePropEntity.qc +++ b/src/gs-entbase/shared/NSSurfacePropEntity.qc @@ -95,7 +95,7 @@ NSSurfacePropEntity::Respawn(void) NSRenderableEntity::Respawn(); /* only use spawndata's health if we aren't overriding it */ - if (HasPropData() == TRUE && sh == -1) { + if (HasPropData() == TRUE && sh <= 0) { health = (float)GetPropData(PROPINFO_HEALTH); } else { health = sh; @@ -182,8 +182,7 @@ NSSurfacePropEntity::SpawnKey(string strKey, string strValue) { switch (strKey) { case "health": - int h = stoi(strValue); - health = (float)h; + health = stof(strValue); m_oldHealth = health; break; case "propdata": @@ -303,7 +302,6 @@ NSSurfacePropEntity::NSSurfacePropEntity(void) #ifdef SERVER m_iPropData = -1; m_iMaterial = -1; - m_oldHealth = health = -1; super::NSRenderableEntity(); diff --git a/src/shared/sound.h b/src/shared/sound.h index 291caf1b..ff92ce86 100644 --- a/src/shared/sound.h +++ b/src/shared/sound.h @@ -26,8 +26,9 @@ typedef enumflags SNDFL_NOREVERB, /* skip reverb */ SNDFL_OMNI, /* volume on all channels is equal */ SNDFL_PRIVATE, /* only play on target */ - SNDFL_STEP, /* volume is calculated from entity speed */ - SNDFL_FOLLOW + SNDFL_STEP, /* volume is calculated from entity speed */ + SNDFL_FOLLOW, + SNDFL_ALERTS /* this sounds alerts AI, takes distance into account */ } soundFlag_t; typedef struct diff --git a/src/shared/sound.qc b/src/shared/sound.qc index fb930a14..8382ff5a 100644 --- a/src/shared/sound.qc +++ b/src/shared/sound.qc @@ -161,6 +161,10 @@ Sound_ParseField(int i, int a) case "distshader": g_sounds[i].distshader = argv(1); break; + case "alerts": + dprint("\tSound set to alert enemy AI\n"); + g_sounds[i].flags |= SNDFL_ALERTS; + break; case "sample": if (a == 2) { dprint("\tAdded sample "); @@ -456,6 +460,9 @@ Sound_Play(entity target, int chan, string shader) flag |= SOUNDFLAG_UNICAST; msg_entity = target; } + if (g_sounds[sample].flags & SNDFL_ALERTS) { + NSMonster_AlertEnemyAlliance(target.origin, g_sounds[sample].dist_max, target.m_iAlliance); + } #endif #ifdef DEVELOPER diff --git a/src/vgui/ui.qc b/src/vgui/ui.qc index 6773b891..8c9b5248 100644 --- a/src/vgui/ui.qc +++ b/src/vgui/ui.qc @@ -25,6 +25,12 @@ var int g_vguiWidgetCount; var float UI_MAINALPHA; #endif +void +VGUI_Active(void) +{ + return (g_vguiWidgetCount > 0) ? TRUE : FALSE; +} + int Util_MouseAbove(vector vecMousePos, vector vecPos, vector vecSize) { diff --git a/worldspawn b/worldspawn index 9183273a..e35b2e39 100755 --- a/worldspawn +++ b/worldspawn @@ -7,7 +7,12 @@ if [ ! -f "$SRCPATH"/bin/worldspawn ]; then fi cd "$SRCPATH"/bin -./worldspawn + +if [[ -z "${NUCLIDE_GDB}" ]]; then + ./worldspawn ../ $* +else + gdb --args ./worldspawn ../ $* +fi