Fix a slew of warnings.
This commit is contained in:
parent
71dc508bad
commit
3e421aab57
30 changed files with 160 additions and 82 deletions
BIN
base/csprogs.dat
BIN
base/csprogs.dat
Binary file not shown.
BIN
base/menu.dat
BIN
base/menu.dat
Binary file not shown.
BIN
base/progs.dat
BIN
base/progs.dat
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -14,6 +14,8 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
float(vector org, float radius, vector lightcolours, optional float style, optional string cubemapname, optional float pflags) dynamiclight_spawnstatic2 = #0:dynamiclight_spawnstatic;
|
||||
|
||||
void Commandmenu_Open(void);
|
||||
void Commandmenu_Close(void);
|
||||
|
||||
|
@ -24,12 +26,12 @@ CMD_testLight(void)
|
|||
string cubeTexture = argv(1);
|
||||
|
||||
if (STRING_SET(cubeTexture)) {
|
||||
p = dynamiclight_spawnstatic(g_view.GetCameraOrigin(), 512, [1,1,1], 0, cubeTexture);
|
||||
p = dynamiclight_spawnstatic2(g_view.GetCameraOrigin(), 512, [1,1,1], 0, cubeTexture);
|
||||
dynamiclight_set(p, LFIELD_ANGLES, g_view.GetCameraAngle());
|
||||
dynamiclight_set(p, LFIELD_FLAGS, LFLAG_NORMALMODE | LFLAG_REALTIMEMODE | LFLAG_SHADOWMAP);
|
||||
dynamiclight_set(p, LFIELD_STYLE, 64);
|
||||
} else {
|
||||
p = dynamiclight_spawnstatic(g_view.GetCameraOrigin(), 512, [1,1,1], 0);
|
||||
p = dynamiclight_spawnstatic2(g_view.GetCameraOrigin(), 512, [1,1,1], 0);
|
||||
dynamiclight_set(p, LFIELD_STYLE, 2);
|
||||
}
|
||||
|
||||
|
@ -65,7 +67,7 @@ CMD_testSpotLight(void)
|
|||
glow.RendererRestarted();
|
||||
glow.vv_flags |= VFL_VIDREMOVE;
|
||||
} else {
|
||||
p = dynamiclight_spawnstatic(g_view.GetCameraOrigin(), 512, [1,1,1], 0);
|
||||
p = dynamiclight_spawnstatic2(g_view.GetCameraOrigin(), 512, [1,1,1], 0);
|
||||
dynamiclight_set(p, LFIELD_STYLE, 2);
|
||||
}
|
||||
|
||||
|
@ -77,7 +79,7 @@ CMD_testPointLight(void)
|
|||
{
|
||||
makevectors(g_view.GetCameraAngle());
|
||||
traceline(g_view.GetCameraOrigin(), g_view.GetCameraOrigin() + (v_forward * 4096.0f), MOVE_NORMAL, pSeat->m_ePlayer);
|
||||
dynamiclight_spawnstatic(trace_endpos + (v_forward * -16.0f), 1024, [1,1,1]);
|
||||
dynamiclight_spawnstatic2(trace_endpos + (v_forward * -16.0f), 1024, [1,1,1]);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -42,9 +42,11 @@ public:
|
|||
virtual void Restore(string,string);
|
||||
nonvirtual void Setup(void);
|
||||
virtual void Touch(entity);
|
||||
virtual void Precaches(void);
|
||||
|
||||
private:
|
||||
int m_iIsCan;
|
||||
string m_spawnSound;
|
||||
};
|
||||
|
||||
void
|
||||
|
@ -52,6 +54,13 @@ item_food::item_food(void)
|
|||
{
|
||||
// TODO: differentiate between item_sodacan and item_food
|
||||
m_iIsCan = 1;
|
||||
m_spawnSound = "weapons/g_bounce3.wav";
|
||||
}
|
||||
|
||||
void
|
||||
item_food::Precaches(void)
|
||||
{
|
||||
precache.Sound(m_spawnSound);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -94,7 +103,7 @@ item_food::Setup(void)
|
|||
SetSize([-16,-16,-16], [16,16,16]);
|
||||
|
||||
//if (m_iIsCan) {
|
||||
sound(this, CHAN_ITEM, "weapons/g_bounce3.wav", 1.0f, ATTN_NORM);
|
||||
sound(this, CHAN_ITEM, m_spawnSound, 1.0f, ATTN_NORM);
|
||||
//}
|
||||
}
|
||||
|
||||
|
|
|
@ -94,11 +94,13 @@ private:
|
|||
int m_iSpawnDensity;
|
||||
float m_flSpawnFrequency;
|
||||
float m_flSpawnCurrent;
|
||||
string m_bubbleModel;
|
||||
};
|
||||
|
||||
void
|
||||
env_bubbles::env_bubbles(void)
|
||||
{
|
||||
m_bubbleModel = "sprites/bubble.spr";
|
||||
}
|
||||
|
||||
#ifdef SERVER
|
||||
|
@ -253,7 +255,7 @@ env_bubbles::EmitBubbles(void)
|
|||
|
||||
env_sprite eBubble = spawn(env_sprite);
|
||||
setorigin(eBubble, vecPos);
|
||||
setmodel(eBubble, "sprites/bubble.spr");
|
||||
setmodel(eBubble, m_bubbleModel);
|
||||
eBubble.drawmask = MASK_ENGINE;
|
||||
eBubble.SetRenderColor([255,255,255]);
|
||||
eBubble.SetRenderMode(RM_ADDITIVE);
|
||||
|
@ -354,5 +356,5 @@ env_bubbles::Respawn(void)
|
|||
void
|
||||
env_bubbles::Precache(void)
|
||||
{
|
||||
precache.Model("sprites/bubble.spr");
|
||||
precache.Model(m_bubbleModel);
|
||||
}
|
||||
|
|
|
@ -46,6 +46,7 @@ public:
|
|||
virtual float predraw(void);
|
||||
virtual void ReceiveEntity(float,float);
|
||||
virtual void DrawSegment(vector, vector, vector);
|
||||
virtual void RendererRestarted(void);
|
||||
#endif
|
||||
|
||||
#ifdef SERVER
|
||||
|
@ -91,9 +92,6 @@ phys_rope::DrawSegment(vector pos1, vector pos2, vector vecPlayer)
|
|||
float
|
||||
phys_rope::predraw(void)
|
||||
{
|
||||
vector pos1;
|
||||
vector pos2;
|
||||
float segments;
|
||||
vector vecPlayer;
|
||||
ncPlayer pl;
|
||||
|
||||
|
|
|
@ -164,9 +164,8 @@ ncNavInfo::FindEmptySpotNearPosition(entity traceEntity, vector position, float
|
|||
vector testPos = g_vec_null;
|
||||
|
||||
for (float yawTest = 0.0f; yawTest < 360.0f; yawTest += 10.0f) {
|
||||
vector testPos;
|
||||
float distSquared;
|
||||
vector testAngle = traceEntity.angles = [0, yawTest, 0];
|
||||
testAngle = traceEntity.angles = [0, yawTest, 0];
|
||||
testAngle[0] = testAngle[2] = 0.0f;
|
||||
makevectors(testAngle);
|
||||
testPos = position + (v_forward * 2048.0f);
|
||||
|
@ -185,10 +184,10 @@ ncNavInfo::FindEmptySpotNearPosition(entity traceEntity, vector position, float
|
|||
}
|
||||
|
||||
for (float dist = minRadius; dist < maxRadius; dist += ((maxRadius - minRadius) / 16.0f)) {
|
||||
vector testAngle = [0, bestYaw, 0];
|
||||
testAngle = [0, bestYaw, 0];
|
||||
testAngle[0] = testAngle[2] = 0.0f;
|
||||
makevectors(testAngle);
|
||||
vector testPos = position + (v_forward * dist);
|
||||
testPos = position + (v_forward * dist);
|
||||
tracebox(testPos, traceEntity.mins, traceEntity.maxs, testPos, MOVE_NORMAL, traceEntity);
|
||||
|
||||
if (!trace_startsolid) {
|
||||
|
@ -209,9 +208,8 @@ ncNavInfo::FindEmptySpotAwayFromPosition(entity traceEntity, vector position, fl
|
|||
vector testPos = g_vec_null;
|
||||
|
||||
for (float yawTest = 0.0f; yawTest < 360.0f; yawTest += 10.0f) {
|
||||
vector testPos;
|
||||
float distSquared;
|
||||
vector testAngle = traceEntity.angles = [0, yawTest, 0];
|
||||
testAngle = traceEntity.angles = [0, yawTest, 0];
|
||||
testAngle[0] = testAngle[2] = 0.0f;
|
||||
makevectors(testAngle);
|
||||
testPos = position + (v_forward * 2048.0f);
|
||||
|
@ -230,10 +228,10 @@ ncNavInfo::FindEmptySpotAwayFromPosition(entity traceEntity, vector position, fl
|
|||
}
|
||||
|
||||
for (float dist = maxRadius; dist > minRadius; dist -= ((maxRadius - minRadius) / 16.0f)) {
|
||||
vector testAngle = [0, bestYaw, 0];
|
||||
testAngle = [0, bestYaw, 0];
|
||||
testAngle[0] = testAngle[2] = 0.0f;
|
||||
makevectors(testAngle);
|
||||
vector testPos = position + (v_forward * dist);
|
||||
testPos = position + (v_forward * dist);
|
||||
tracebox(testPos, traceEntity.mins, traceEntity.maxs, testPos, MOVE_NORMAL, traceEntity);
|
||||
|
||||
if (!trace_startsolid) {
|
||||
|
|
|
@ -46,8 +46,8 @@ ncSchedule::InProgress(void)
|
|||
void
|
||||
ncSchedule::Advance(void)
|
||||
{
|
||||
string taskInput;
|
||||
string taskParms;
|
||||
string taskInput = "";
|
||||
string taskParms = "";
|
||||
bool shouldCancel = false;
|
||||
|
||||
if (wasfreed(this)) {
|
||||
|
@ -180,7 +180,7 @@ ncSchedule::Message(string messageString)
|
|||
}
|
||||
|
||||
if (lookUpValue) {
|
||||
EntLog("^1schedule killed by message.", taskInput, taskParameter);
|
||||
EntLog("^1schedule killed by message.");
|
||||
ReleaseThink();
|
||||
Cancel();
|
||||
}
|
||||
|
|
|
@ -53,6 +53,30 @@ SVPF_game_CleanUpMap(void)
|
|||
multicast([0,0,0], MULTICAST_ALL);
|
||||
}
|
||||
|
||||
entity
|
||||
SVPF_ents_NextItem(entity lastItem)
|
||||
{
|
||||
return findfloat(lastItem, ::_isItem, 1);
|
||||
}
|
||||
|
||||
entity
|
||||
SVPF_ents_NextWeapon(entity lastItem)
|
||||
{
|
||||
return findfloat(lastItem, ::_isWeapon, 1);
|
||||
}
|
||||
|
||||
entity
|
||||
SVPF_ents_NextActor(entity lastItem)
|
||||
{
|
||||
return findfloat(lastItem, ::_isActor, 1);
|
||||
}
|
||||
|
||||
entity
|
||||
SVPF_ents_NextPlayer(entity lastItem)
|
||||
{
|
||||
return findfloat(lastItem, ::_isPlayer, 1);
|
||||
}
|
||||
|
||||
string
|
||||
SVPF_game_GetMap(void)
|
||||
{
|
||||
|
|
|
@ -93,6 +93,34 @@ typedef struct
|
|||
|
||||
@param entityToCheck specifies the entity to check.*/
|
||||
bool isBot(entity entityToCheck);
|
||||
|
||||
|
||||
/** Returns the next entity of type 'Item' in the game.
|
||||
|
||||
@param lastItem The previous item, can be `world` or `__NULL__` or `0` to retrieve the first item.
|
||||
@return The next item in the entity pool. Will be `world` or `__NULL__` if none are left. */
|
||||
entity NextItem(entity lastItem);
|
||||
|
||||
|
||||
/** Returns the next entity of type 'Weapon' in the game.
|
||||
|
||||
@param lastWeapon The previous item, can be `world` or `__NULL__` or `0` to retrieve the first item.
|
||||
@return The next item in the entity pool. Will be `world` or `__NULL__` if none are left. */
|
||||
entity NextWeapon(entity lastWeapon);
|
||||
|
||||
|
||||
/** Returns the next entity of type 'Actor' in the game.
|
||||
|
||||
@param lastActor The previous item, can be `world` or `__NULL__` or `0` to retrieve the first item.
|
||||
@return The next item in the entity pool. Will be `world` or `__NULL__` if none are left. */
|
||||
entity NextActor(entity lastActor);
|
||||
|
||||
|
||||
/** Returns the next entity of type 'Player' in the game.
|
||||
|
||||
@param lastPlayer The previous item, can be `world` or `__NULL__` or `0` to retrieve the first item.
|
||||
@return The next item in the entity pool. Will be `world` or `__NULL__` if none are left. */
|
||||
entity NextPlayer(entity lastPlayer);
|
||||
} entsAPI_t;
|
||||
var entsAPI_t ents;
|
||||
|
||||
|
@ -214,6 +242,12 @@ _server_main(void)
|
|||
ents.isPlayer = linkToServerProgs("isPlayer");
|
||||
ents.isSentient = linkToServerProgs("isSentient");
|
||||
|
||||
/* helpful finder */
|
||||
ents.NextActor = linkToServerProgs("SVPF_ents_NextActor");
|
||||
ents.NextItem = linkToServerProgs("SVPF_ents_NextItem");
|
||||
ents.NextWeapon = linkToServerProgs("SVPF_ents_NextWeapon");
|
||||
ents.NextPlayer = linkToServerProgs("SVPF_ents_NextPlayer");
|
||||
|
||||
actor.GetInventory = linkToServerProgs("SVPF_actor_GetInventory");
|
||||
actor.GetReserveAmmo = linkToServerProgs("SVPF_actor_GetReserveAmmo");
|
||||
actor.MaxAmmo = linkToServerProgs("SVPF_actor_MaxAmmo");
|
||||
|
|
|
@ -703,7 +703,7 @@ CheckSpawn(void() spawnfunc)
|
|||
1. maptweaks, can override anything.
|
||||
2. entitydef, can even override built-in class names
|
||||
2.0 entitydef, defined in a map (maps/foobar.def)
|
||||
2.1 entitydef, defined within decls/def/*.def
|
||||
2.1 entitydef, defined within decls/def/X.def
|
||||
3. in-code classes */
|
||||
if (MapTweak_EntitySpawn(ent) == true) {
|
||||
skipLoad = true;
|
||||
|
|
|
@ -165,7 +165,7 @@ public:
|
|||
|
||||
/** Overridable: Called regularily to select a new schedule to perform. */
|
||||
virtual void SelectNewSchedule(void);
|
||||
nonvirtual void ScheduleThink(void);
|
||||
nonvirtual void ThinkSchedules(void);
|
||||
|
||||
/** Forces a named schedule to be performed. */
|
||||
nonvirtual bool CancelSchedule(void);
|
||||
|
@ -261,6 +261,7 @@ private:
|
|||
.ncItem m_itemList;
|
||||
.ncWeapon m_activeWeapon;
|
||||
.ncWeapon m_firstWeapon;
|
||||
.bool _isActor;
|
||||
|
||||
void ncActor_ListInventory(ncActor);
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
void
|
||||
ncActor::ncActor(void)
|
||||
{
|
||||
|
@ -268,7 +267,7 @@ void
|
|||
ncActor::Spawned(void)
|
||||
{
|
||||
super::Spawned();
|
||||
isActor = true;
|
||||
_isActor = true;
|
||||
|
||||
/* let's not waste time and resources */
|
||||
if (wasfreed(this)) {
|
||||
|
@ -346,7 +345,7 @@ ncActor::RestoreComplete(void)
|
|||
}
|
||||
|
||||
void
|
||||
ncActor::ScheduleThink(void)
|
||||
ncActor::ThinkSchedules(void)
|
||||
{
|
||||
if (IsPerforming() == false && m_iNodes <= 0i) {
|
||||
SelectNewSchedule();
|
||||
|
@ -470,7 +469,7 @@ ncActor::Input(entity eAct, string strInput, string strData)
|
|||
m_activeSchedule.AdvanceLater(100);
|
||||
break;
|
||||
case "TargetNearestPlayer":
|
||||
entity firstPlayer = find(world, ::classname, "player");
|
||||
ncEntity firstPlayer = (ncEntity)find(world, ::classname, "player");
|
||||
|
||||
if (firstPlayer) {
|
||||
m_activeSchedule.SetTarget(firstPlayer);
|
||||
|
@ -489,10 +488,10 @@ ncActor::Input(entity eAct, string strInput, string strData)
|
|||
}
|
||||
break;
|
||||
case "GoToSpotInRadius":
|
||||
vector t = ncNavInfo::FindEmptySpotNearPosition(this, GetOrigin(), 128.0f, stof(strData));
|
||||
vector spot1 = ncNavInfo::FindEmptySpotNearPosition(this, GetOrigin(), 128.0f, stof(strData));
|
||||
|
||||
if (vlen(t) > 0.0f) {
|
||||
RouteToPosition(t);
|
||||
if (vlen(spot1) > 0.0f) {
|
||||
RouteToPosition(spot1);
|
||||
} else {
|
||||
CancelSchedule();
|
||||
}
|
||||
|
@ -641,7 +640,7 @@ ncActor::CheckRouteProgression(void)
|
|||
|
||||
/* it's accessible */
|
||||
if (!trace_startsolid && trace_fraction == 1.0f) {
|
||||
vector idealAngles = vectoangles(vecNextNode - origin);
|
||||
idealAngles = vectoangles(vecNextNode - origin);
|
||||
evenpos = vecNextNode;
|
||||
m_iCurNode = iNextNode;
|
||||
|
||||
|
|
|
@ -280,7 +280,6 @@ private:
|
|||
x = CreateOutput(x); \
|
||||
}
|
||||
|
||||
.bool isActor;
|
||||
.bool _mapspawned;
|
||||
|
||||
void
|
||||
|
|
|
@ -39,7 +39,10 @@ ncIO::ncIO(void)
|
|||
effects |= EF_NOSHADOW;
|
||||
#endif
|
||||
m_strEditorIcon = "gfx/icon16/bullet_purple";
|
||||
isActor = false;
|
||||
_isActor = false;
|
||||
_isItem = false;
|
||||
_isPlayer = false;
|
||||
_isWeapon = false;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -87,6 +87,7 @@ public:
|
|||
nonvirtual void SetSpinning(bool);
|
||||
nonvirtual bool GetSpinning(void);
|
||||
nonvirtual void PickupRespawn(void);
|
||||
nonvirtual void SetRespawnTime(float);
|
||||
|
||||
/* only if the entity is usable in the inventory. */
|
||||
virtual void OnInventoryUse(void);
|
||||
|
@ -130,6 +131,7 @@ private:
|
|||
int m_iInvItem;
|
||||
string m_sndAcquire;
|
||||
string m_sndRespawn;
|
||||
float m_flRespawn;
|
||||
string m_sndHum;
|
||||
int m_bFloating;
|
||||
bool m_bSpins;
|
||||
|
@ -149,6 +151,11 @@ private:
|
|||
NETWORKED_FLOAT(owner_entnum)
|
||||
#endif
|
||||
|
||||
#ifdef SERVER
|
||||
float m_hiddenModelIndex;
|
||||
float m_hiddenSequence;
|
||||
#endif
|
||||
|
||||
ncItem m_nextItem;
|
||||
ncItem m_nextItem_net;
|
||||
entity owner_net;
|
||||
|
|
|
@ -31,6 +31,7 @@ ncItem::ncItem(void)
|
|||
m_strRequires = __NULL__;
|
||||
m_nextItem = __NULL__;
|
||||
owner = __NULL__;
|
||||
m_flRespawn = 0;
|
||||
}
|
||||
|
||||
#ifdef SERVER
|
||||
|
@ -123,6 +124,9 @@ ncItem::SpawnKey(string strKey, string strValue)
|
|||
case "requires":
|
||||
m_strRequires = ReadString(strValue);
|
||||
break;
|
||||
case "respawn":
|
||||
m_flRespawn = ReadFloat(strValue);
|
||||
break;
|
||||
default:
|
||||
super::SpawnKey(strKey, strValue);
|
||||
break;
|
||||
|
@ -207,6 +211,10 @@ void
|
|||
ncItem::Input(entity eAct, string strInput, string strData)
|
||||
{
|
||||
switch (strInput) {
|
||||
/* gamemodes can alternatively use this to set the respawn time of items post-init */
|
||||
case "SetRespawnTime":
|
||||
SetRespawnTime(stof(strData));
|
||||
break;
|
||||
default:
|
||||
ncTrigger::Input(eAct, strInput, strData);
|
||||
}
|
||||
|
@ -218,6 +226,12 @@ ncItem::OnUse(entity user)
|
|||
|
||||
}
|
||||
|
||||
void
|
||||
ncItem::SetRespawnTime(float newTime)
|
||||
{
|
||||
m_flRespawn = newTime;
|
||||
}
|
||||
|
||||
bool
|
||||
ncItem::ItemPickupCheck(entity pickerUpper)
|
||||
{
|
||||
|
@ -281,13 +295,24 @@ ncItem::Touch(entity eToucher)
|
|||
/* don't remove if AddItem fails */
|
||||
string itemToAdd = (m_strInvWeapon) ? m_strInvWeapon : classname;
|
||||
pl.GiveItem(itemToAdd);
|
||||
|
||||
/* if we have the carry flag set in addition, we'll put in an extra copy of this item */
|
||||
if (STRING_SET(m_strInvWeapon) && m_bInvCarry) {
|
||||
pl.GiveItem(classname);
|
||||
}
|
||||
|
||||
UseTargets(pl, TRIG_TOGGLE, m_flDelay);
|
||||
|
||||
if (real_owner || m_iWasDropped == 1 || cvar("sv_playerslots") == 1) {
|
||||
if (m_flRespawn <= 0) {
|
||||
Destroy();
|
||||
} else {
|
||||
if (m_hiddenSequence) {
|
||||
SetFrame(m_hiddenSequence);
|
||||
} else {
|
||||
Disappear();
|
||||
ScheduleThink(PickupRespawn, 30.0f);
|
||||
}
|
||||
|
||||
ScheduleThink(PickupRespawn, m_flRespawn);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -359,6 +384,8 @@ ncItem::BecomePickup(void)
|
|||
modelflags &= ~MF_ROTATE;
|
||||
|
||||
Show();
|
||||
SetFrame(GetSpawnFloat("frame"));
|
||||
m_hiddenSequence = GetSpawnFloat("hidden_frame");
|
||||
|
||||
if (/*GetSpawnBool("physics") == true*/ 0) {
|
||||
/* be shootable! */
|
||||
|
|
|
@ -390,10 +390,14 @@ public:
|
|||
virtual void TriggerTargets(void);
|
||||
|
||||
virtual void Trigger(entity, triggermode_t);
|
||||
nonvirtual void AlertNearbyToSchedule(string scheduleType);
|
||||
nonvirtual bool ShouldTurn(void);
|
||||
#endif
|
||||
|
||||
nonvirtual vector GetHeadAngles(void);
|
||||
|
||||
virtual void DebugDraw(void);
|
||||
|
||||
#ifdef CLIENT
|
||||
|
||||
/** overrides */
|
||||
|
|
|
@ -842,7 +842,7 @@ ncMonster::SeeThink(void)
|
|||
}
|
||||
|
||||
/* iterate through all players, monsters. */
|
||||
for (entity w = world; (w = findfloat(w, ::isActor, 1));) {
|
||||
for (entity w = world; (w = findfloat(w, ::_isActor, 1));) {
|
||||
if (w.takedamage == DAMAGE_NO)
|
||||
continue;
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ ncMonster::RunAI(void)
|
|||
}
|
||||
|
||||
if (InScriptedSequence() == false) {
|
||||
ScheduleThink();
|
||||
ThinkSchedules();
|
||||
}
|
||||
|
||||
SeeThink();
|
||||
|
@ -2244,8 +2244,7 @@ ncMonster::Input( entity entityActivator, string inputName, string dataField )
|
|||
AnimPlay(GetDefAct(dataField));
|
||||
|
||||
if (m_activeSchedule) {
|
||||
float waitTime = frameduration(modelindex, frame);
|
||||
m_activeSchedule.AdvanceLater(waitTime);
|
||||
m_activeSchedule.AdvanceLater(frameduration(modelindex, frame));
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -2257,12 +2256,11 @@ ncMonster::Input( entity entityActivator, string inputName, string dataField )
|
|||
AnimPlay(frameforname(modelindex, dataField));
|
||||
|
||||
if (m_activeSchedule) {
|
||||
float waitTime = frameduration(modelindex, frame);
|
||||
m_activeSchedule.AdvanceLater(waitTime);
|
||||
m_activeSchedule.AdvanceLater(frameduration(modelindex, frame));
|
||||
}
|
||||
|
||||
} else {
|
||||
NSError("'PlaySequence' without animation sequence, blame %S (%d)", entityActivator, num_for_edict(entityActivator));
|
||||
NSError("'PlaySequence' without animation sequence, blame %S (%d)", entityActivator.classname, num_for_edict(entityActivator));
|
||||
}
|
||||
break;
|
||||
case "FindCoverFromEnemy":
|
||||
|
|
|
@ -590,16 +590,17 @@ ncPhysicsEntity::Touch(entity eToucher)
|
|||
}
|
||||
}
|
||||
|
||||
ncDict damageDecl;
|
||||
if (eToucher && impactForce >= 1.0 && eToucher.takedamage != DAMAGE_NO) {
|
||||
ncSurfacePropEntity impactingEntity = (ncSurfacePropEntity)eToucher;
|
||||
ncDict damageDecl = spawn(ncDict);
|
||||
damageDecl = spawn(ncDict);
|
||||
damageDecl.AddKey("damage", ftos(impactForce));
|
||||
damageDecl.AddKey("push", "0"); /* avoid physics recursion/amplification */
|
||||
impactingEntity.Damage(this, this, damageDecl, 1.0f, g_vec_null, GetOrigin());
|
||||
remove(damageDecl);
|
||||
} else {
|
||||
if (impactForce > GetHealth()) {
|
||||
ncDict damageDecl = spawn(ncDict);
|
||||
damageDecl = spawn(ncDict);
|
||||
damageDecl.AddKey("damage", ftos(impactForce));
|
||||
damageDecl.AddKey("push", "0"); /* avoid physics recursion/amplification */
|
||||
Damage(eToucher, eToucher, damageDecl, 1.0f, g_vec_null, GetOrigin());
|
||||
|
|
|
@ -237,3 +237,5 @@ enumflags
|
|||
#ifdef SERVER
|
||||
void obituary(string, string, string, string);
|
||||
#endif
|
||||
|
||||
.bool _isPlayer;
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
void
|
||||
ncPlayer::ncPlayer(void)
|
||||
{
|
||||
_isPlayer = true;
|
||||
flags |= FL_CLIENT;
|
||||
vehicle = __NULL__;
|
||||
}
|
||||
|
|
|
@ -560,7 +560,7 @@ ncProjectile::Touch(entity eToucher)
|
|||
|
||||
if (eToucher.takedamage != DAMAGE_NO) {
|
||||
m_hitLocation = m_vecImpactPos;
|
||||
m_eMultiTarget = eToucher;
|
||||
m_eMultiTarget = (ncSurfacePropEntity)eToucher;
|
||||
m_iMultiValue = GetSubDefInt(m_defDamage, "damage");
|
||||
_ApplyDamage();
|
||||
}
|
||||
|
|
|
@ -732,7 +732,7 @@ ncTalkMonster::RunAI(void)
|
|||
}
|
||||
|
||||
if (InScriptedSequence() == false) {
|
||||
ScheduleThink();
|
||||
ThinkSchedules();
|
||||
}
|
||||
|
||||
SeeThink();
|
||||
|
|
|
@ -198,13 +198,6 @@ string Util_TimeToString(float fTime);
|
|||
bool Util_IsTeamplay(void);
|
||||
bool Util_IsPaused(void);
|
||||
|
||||
__wrap void
|
||||
dprint(string m)
|
||||
{
|
||||
if (cvar("developer") == 1)
|
||||
return prior(m);
|
||||
}
|
||||
|
||||
void
|
||||
crossprint(string m)
|
||||
{
|
||||
|
|
|
@ -439,6 +439,8 @@ EntityDef_PrepareEntity(entity target, int id)
|
|||
static void
|
||||
EntityDef_Precaches(int index)
|
||||
{
|
||||
int defID = 0i;
|
||||
|
||||
if (time > 2.0f) {
|
||||
return;
|
||||
}
|
||||
|
@ -458,7 +460,7 @@ EntityDef_Precaches(int index)
|
|||
} else if (substring(strKey, 0, 6) == "model_") {
|
||||
precache.Model(strValue);
|
||||
} else if (substring(strKey, 0, 4) == "def_" || (strKey == "item")) {
|
||||
int defID = EntityDef_IDFromName(strValue);
|
||||
defID = EntityDef_IDFromName(strValue);
|
||||
|
||||
/* only precache valid def, and avoid recursion */
|
||||
if (defID != -1 && defID != index) {
|
||||
|
@ -467,7 +469,7 @@ EntityDef_Precaches(int index)
|
|||
} else if (strKey == "weapon") {
|
||||
for (int w = 0; w < tokenizebyseparator(strValue, ","); w++) {
|
||||
string weaponName = argv(w);
|
||||
int defID = EntityDef_IDFromName(weaponName);
|
||||
defID = EntityDef_IDFromName(weaponName);
|
||||
|
||||
/* only precache valid def, and avoid recursion */
|
||||
if (defID != -1 && defID != index) {
|
||||
|
|
|
@ -151,32 +151,26 @@ Sound_ParseField(int i, int a, string keyName, string valueCS)
|
|||
break;
|
||||
case "dist_min":
|
||||
if (a == 2) {
|
||||
dprint("\tMin distance set\n");
|
||||
g_sounds[i].dist_min = stof(setValue);
|
||||
}
|
||||
break;
|
||||
case "dist_max":
|
||||
if (a == 2) {
|
||||
dprint("\tMax distance set\n");
|
||||
g_sounds[i].dist_max = stof(setValue);
|
||||
}
|
||||
break;
|
||||
case "volume":
|
||||
if (a == 2) {
|
||||
dprint("\tVolume set\n");
|
||||
g_sounds[i].volume = stof(setValue);
|
||||
}
|
||||
break;
|
||||
case "shakes":
|
||||
if (a == 2) {
|
||||
dprint("\tShake set\n");
|
||||
g_sounds[i].shakes = stof(setValue);
|
||||
}
|
||||
break;
|
||||
case "pitch":
|
||||
if (a == 2) {
|
||||
dprint("\tPitch set\n");
|
||||
|
||||
int comma = tokenizebyseparator(setValue, ",");
|
||||
|
||||
if (comma == 2) {
|
||||
|
@ -190,48 +184,38 @@ Sound_ParseField(int i, int a, string keyName, string valueCS)
|
|||
break;
|
||||
case "pitch_min":
|
||||
if (a == 2) {
|
||||
dprint("\tMinimum pitch set\n");
|
||||
g_sounds[i].pitch_min = fabs(stof(setValue)) * 100;
|
||||
}
|
||||
break;
|
||||
case "pitch_max":
|
||||
if (a == 2) {
|
||||
dprint("\tMaximum pitch set\n");
|
||||
g_sounds[i].pitch_max = fabs(stof(setValue)) * 100;
|
||||
}
|
||||
break;
|
||||
case "offset":
|
||||
if (a == 2) {
|
||||
dprint("\tOffset set\n");
|
||||
g_sounds[i].offset = stof(setValue);
|
||||
}
|
||||
break;
|
||||
case "looping":
|
||||
dprint("\tSound set to loop\n");
|
||||
g_sounds[i].flags |= SNDFL_LOOPING;
|
||||
break;
|
||||
case "nodups":
|
||||
dprint("\tSound set to not play duplicate samples\n");
|
||||
g_sounds[i].flags |= SNDFL_NODUPS;
|
||||
break;
|
||||
case "global":
|
||||
dprint("\tSound set to play everywhere\n");
|
||||
g_sounds[i].flags |= SNDFL_GLOBAL;
|
||||
break;
|
||||
case "private":
|
||||
dprint("\tSound set to play privately\n");
|
||||
g_sounds[i].flags |= SNDFL_PRIVATE;
|
||||
break;
|
||||
case "no_reverb":
|
||||
dprint("\tSound set to ignore reverb\n");
|
||||
g_sounds[i].flags |= SNDFL_NOREVERB;
|
||||
break;
|
||||
case "omnidirectional":
|
||||
dprint("\tSound set to be omnidirectional\n");
|
||||
g_sounds[i].flags |= SNDFL_OMNI;
|
||||
break;
|
||||
case "follow":
|
||||
dprint("\tSound set to follow\n");
|
||||
g_sounds[i].flags |= SNDFL_FOLLOW;
|
||||
break;
|
||||
case "footstep":
|
||||
|
@ -244,7 +228,6 @@ Sound_ParseField(int i, int a, string keyName, string valueCS)
|
|||
g_sounds[i].pointparticle = particleeffectnum(valueCS);
|
||||
break;
|
||||
case "alerts":
|
||||
dprint("\tSound set to alert enemy AI\n");
|
||||
g_sounds[i].flags |= SNDFL_ALERTS;
|
||||
break;
|
||||
case "wave":
|
||||
|
@ -261,10 +244,6 @@ Sound_ParseField(int i, int a, string keyName, string valueCS)
|
|||
|
||||
case "sample":
|
||||
if (a == 2) {
|
||||
dprint("\tAdded sample ");
|
||||
dprint(setValue);
|
||||
dprint("\n");
|
||||
|
||||
if (precacheSound)
|
||||
precache_sound(setValue);
|
||||
|
||||
|
@ -300,7 +279,6 @@ Sound_Parse(int i, string line, string shader)
|
|||
break;
|
||||
}
|
||||
|
||||
dprint("{\n");
|
||||
braced = TRUE;
|
||||
break;
|
||||
case "}":
|
||||
|
@ -308,7 +286,6 @@ Sound_Parse(int i, string line, string shader)
|
|||
if (braced == FALSE) {
|
||||
break;
|
||||
}
|
||||
dprint("}\n");
|
||||
braced = FALSE;
|
||||
t_name = "";
|
||||
return (1);
|
||||
|
@ -322,9 +299,6 @@ Sound_Parse(int i, string line, string shader)
|
|||
|
||||
if (t_name == shader) {
|
||||
/* I guess it's what we want */
|
||||
dprint("Found shader ");
|
||||
dprint(shader);
|
||||
dprint(":\n");
|
||||
g_sounds[i].name = shader;
|
||||
} else {
|
||||
/* not what we're looking for */
|
||||
|
|
Loading…
Reference in a new issue