Ejemplo n.º 1
0
void CFuncVehicleControls::Find()
{
	CFuncVehicle *pVehicle = nullptr;
	while ((pVehicle = UTIL_FindEntityByTargetname(pVehicle, pev->target)))
	{
		if (FClassnameIs(pVehicle->pev, "func_vehicle"))
			break;
	}

	if (FNullEnt(pVehicle))
	{
		ALERT(at_console, "No vehicle %s\n", STRING(pev->target));
		return;
	}

	pVehicle->SetControls(pev);
	UTIL_Remove(this);
}
Ejemplo n.º 2
0
/* <1bbd36> ../cstrike/dlls/vehicle.cpp:1067 */
void CFuncVehicleControls::Find()
{
    edict_t *pTarget = NULL;

    do
    {
        pTarget = FIND_ENTITY_BY_TARGETNAME(pTarget, STRING(pev->target));
    }
    while (!FNullEnt(pTarget) && !FClassnameIs(pTarget, "func_vehicle"));

    if (FNullEnt(pTarget))
    {
        ALERT(at_console, "No vehicle %s\n", STRING(pev->target));
        return;
    }

    CFuncVehicle *pvehicle = CFuncVehicle::Instance(pTarget);

    pvehicle->SetControls(pev);
    UTIL_Remove(this);
}