Example #1
0
void Module::usePC(Creature *creature) {
	unloadPC();

	_pc.reset(creature);

	setPCTokens();
	LangMan.setCurrentGender(_pc->isFemale() ? Aurora::kLanguageGenderFemale : Aurora::kLanguageGenderMale);

	addObject(*_pc);
}
Example #2
0
void Module::usePC(const Common::UString &bic, bool local) {
	unloadPC();

	if (bic.empty())
		throw Common::Exception("Tried to load an empty PC");

	try {
		_pc = new Creature(bic, local);
	} catch (Common::Exception &e) {
		e.add("Can't load PC \"%s\"", bic.c_str());
		throw e;
	}

	setPCTokens();
	LangMan.setCurrentGender(_pc->isFemale() ? Aurora::kLanguageGenderFemale : Aurora::kLanguageGenderMale);

	addObject(*_pc);
}
Example #3
0
bool Module::usePC(const Common::UString &bic, bool local) {
	unloadPC();

	if (bic.empty())
		return false;

	try {
		_pc = new Creature(bic, local);
	} catch (Common::Exception &e) {
		delete _pc;
		_pc = 0;

		e.add("Can't load PC \"%s\"", bic.c_str());
		Common::printException(e, "WARNING: ");
	}

	setPCTokens();
	TalkMan.setGender((Aurora::Gender) _pc->getGender());

	addObject(*_pc);

	return true;
}