djcev.com

//

Git Repos / fte_dogmode / qc / triggers / setcount.qc

Last update to this file was on 2025-08-13 at 05:20.

Show setcount.qc

//==============================================================================
// target_setcount
//==============================================================================

/** TODO CEV figure out what this is doing **/

//======================================================================
// forward declarations
//======================================================================

#ifdef SSQC
// target_setcount
void(string name, .string fld) target_setcount_set;
void() target_setcount_use;
void(entity e) target_setcount_init;
void() target_setcount;
#endif

//------------------------------------------------------------------------------

#ifdef SSQC
//----------------------------------------------------------------------
// target_setcount
//----------------------------------------------------------------------
// class target_setcount: base_trigger
// {
//--------------------------------------------------------------
void(string name, .string fld) target_setcount_set =
{
local entity t;

t = find (world, fld, name);

while (t)
{
if (self.style == 1)
t.count += self.count;
else
t.count = self.count;

t = find (t, fld, name);
}
};

//--------------------------------------------------------------
void() target_setcount_use =
{
if (self.target && self.target != "")
{
target_setcount_set (self.target, targetname);
target_setcount_set (self.target, targetname2);
target_setcount_set (self.target, targetname3);
target_setcount_set (self.target, targetname4);
}
if (self.target2 && self.target2 != "")
{
target_setcount_set (self.target2, targetname);
target_setcount_set (self.target2, targetname2);
target_setcount_set (self.target2, targetname3);
target_setcount_set (self.target2, targetname4);
}
if (self.target3 && self.target3 != "")
{
target_setcount_set (self.target3, targetname);
target_setcount_set (self.target3, targetname2);
target_setcount_set (self.target3, targetname3);
target_setcount_set (self.target3, targetname4);
}
if (self.target4 && self.target4 != "")
{
target_setcount_set (self.target4, targetname);
target_setcount_set (self.target4, targetname2);
target_setcount_set (self.target4, targetname3);
target_setcount_set (self.target4, targetname4);
}

if (self.spawnflags & 1)
{
if (self.style == 1)
activator.count += activator.count;
else
activator.count = activator.count;
}
};

//--------------------------------------------------------------
void(entity e) target_setcount_init =
{
e.classname = "target_setcount";
e.classtype = CT_TARGET_SETCOUNT;
e.use = target_setcount_use;
base_mapentity_init (e);
};

//--------------------------------------------------------------
void() target_setcount =
{
BASE_TRIGGER_PREINIT (base_trigger_init_field)
target_setcount_init (self);
};
// };
#endif

Return to the top of this page or return to the overview of this repo.

Log setcount.qc

Return to the top of this page or return to the overview of this repo.