Exemplo n.º 1
0
bool CActor::CanSprint			()
{
	bool can_Sprint = CanAccelerate() && !conditions().IsCantSprint() &&
						Game().PlayerCanSprint(this)
						&& CanRun()
						&& !(mstate_real&mcLStrafe || mstate_real&mcRStrafe)
						&& InventoryAllowSprint()
						;

	return can_Sprint;
}
Exemplo n.º 2
0
int FindFreeGPP(unsigned int mask, struct PE *GPPs) {

	int i;
	for (i = 0; i < GPPs->size; i++) {
		if (!IsProcessorBusy(&GPPs->pe[i]) && CanRun(mask, i)) {
#if DEBUG_PRINT
			fprintf(stderr,"found free GPP %d\n",i);
#endif

			return i;
		}
	}

	return -1;
}
Exemplo n.º 3
0
// Starts. Returns dialogue state.
int Dialogue::Start()
{
	if (activeDialogue)
		return state;
	if (!CanRun())
		return state;
	activeDialogue = this;
	/// Check prerequisites?
	DisplayDialogueBox();
	/// Get next part?
	activePart = parts[0];
	activePart->Parse(); // Parse contents of inital text.
	activePart->Continue(); // Present first text part.
	state = BEGUN;
	return state;
}
Exemplo n.º 4
0
int FindFreePRRPrio(unsigned int mask, struct PE *pRRs) {
	int count = 0;
	int i;
	for (i = count; i < pRRs->size; i++) {
		if (!IsProcessorBusy(&pRRs->pe[i]) && CanRun(mask, i)) {
			count++;
#if DEBUG_PRINT
			fprintf(stderr,"found free PRR %d\n",i);
#endif

			return i;
		}
	}

	return -1;
}
Exemplo n.º 5
0
int FindFreePRRBestCase(unsigned int mask, struct PE *pRRs) {
	static int count = 0;

	int i;
	for (i = count; i < pRRs->size; i++) {
		if (!IsProcessorBusy(&pRRs->pe[i]) && CanRun(mask, i)) {
#if DEBUG_PRINT
			fprintf(stderr,"found free PRR %d\n",i);
#endif

			return i;
		}
	}

	if (count >= pRRs->size - 1) {

		count = 0;
	}
	//fprintf(stderr,"NOT found free PRR B\n");
	return -1;
}