Beispiel #1
0
RETCODE Object::Update()
{
	RETCODE ret = RETCODE_SUCCESS;

	//make sure we are active!
	if(!CheckFlag(OBJ_FLAG_INACTIVE))
	{
		//Update waypoint
		/*if(m_pWayPt)
		{
			D3DXVECTOR3 newPt;

			m_pWayPt->GetCurrentLinearLoc(&newPt);

			if(SetVel(newPt - GetLoc()))
				m_pWayPt->Update();

			if(m_pWayPt->IsDone())
				RemoveWayPt();
		}*/

		//Update script
		if(m_script)
		{
			if(ScriptUpdate(&GetID(), m_script) == RETCODE_BREAK)
				RemoveScript();
		}

		ret = Callback(ENTITYMSG_UPDATE,0,0);
	}

	return ret;
}
Beispiel #2
0
Object::~Object()
{
	RemoveScript();

	//disable the model in the map
	if(BoundGetModelInd() != -1 && g_world->GetMap())
		QBSPModelEnable(g_world->GetMap(), BoundGetModelInd(), false);
}
Beispiel #3
0
void ScriptsTool::on_removeScripts_clicked()
{
	QList<QListWidgetItem *> items = ui->scripts->selectedItems();

	for (QListWidgetItem *item : items)
		RemoveScript(item->data(Qt::UserRole).toString()
				.toUtf8().constData());
	RefreshLists();
}
Beispiel #4
0
// if section is NULL, then
// the entire file is parsed.
// format of section: [<section>_begin]
// 				      ... // code
//					  [<section>_end]
RETCODE Object::LoadScript(const char *filename, const char *section)
{
	RemoveScript();

	char beginStr[MAXCHARBUFF], endStr[MAXCHARBUFF];

	strcpy(beginStr, "[");
	strcat(beginStr, section);
	strcat(beginStr, "_begin]");

	strcpy(endStr, "[");
	strcat(endStr, section);
	strcat(endStr, "_end]");

	m_script = ScriptLoad(&GetID(), filename, beginStr, endStr);

	return RETCODE_SUCCESS;
}
Trigger::~Trigger()
{
	RemoveScript();
}