• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Solved 0.3.1pl2 distance weapon and item use interference

Cornwallis

Member
Joined
Jan 3, 2010
Messages
480
Reaction score
16
Figured this out myself :P goto player.cpp and find
Code:
	Item* tool = getWeapon();
	if(const Weapon* weapon = g_weapons->getWeapon(tool))
	{
		if(weapon->interruptSwing() && !canDoAction())
		{
			SchedulerTask* task = createSchedulerTask(getNextActionTime(), boost::bind(&Game::checkCreatureAttack, &g_game, getID()));
			setNextActionTask(task);
		}
		else if((!hasCondition(CONDITION_EXHAUST, 3) || !weapon->hasExhaustion()) && weapon->useWeapon(this, tool, attackedCreature))
			lastAttack = OTSYS_TIME();
	}
	else if(Weapon::useFist(this, attackedCreature))
		lastAttack = OTSYS_TIME();
and replace with
Code:
	Item* tool = getWeapon();
	if(const Weapon* weapon = g_weapons->getWeapon(tool))
	{
		if((!hasCondition(CONDITION_EXHAUST, 3) || !weapon->hasExhaustion()) && weapon->useWeapon(this, tool, attackedCreature))
			lastAttack = OTSYS_TIME();
	}
	else if(Weapon::useFist(this, attackedCreature))
		lastAttack = OTSYS_TIME();
 
Last edited:
Update; I went into weapons.h and changed this:
Code:
                WeaponDistance(LuaScriptInterface* _interface);
                virtual ~WeaponDistance() {}

                virtual bool configureEvent(xmlNodePtr p);
                virtual bool configureWeapon(const ItemType& it);

                virtual int32_t playerWeaponCheck(Player* player, Creature* target) const;
                virtual bool useWeapon(Player* player, Item* item, Creature* target) const;
                virtual int32_t getWeaponDamage(const Player* player, const Creature* target, const Item* item, bool maxDamage = false) const;
                virtual bool interruptSwing() const {return true;}
to
Code:
virtual bool interruptSwing() const {return false;}

no difference.

Does anyone think it is this?
Code:
	Item* tool = getWeapon();
	if(const Weapon* weapon = g_weapons->getWeapon(tool))
	{
		if(weapon->interruptSwing() && !canDoAction())
		{
			SchedulerTask* task = createSchedulerTask(getNextActionTime(), boost::bind(&Game::checkCreatureAttack, &g_game, getID()));
			setNextActionTask(task);
		}
		else if((!hasCondition(CONDITION_EXHAUST, 3) || !weapon->hasExhaustion()) && weapon->useWeapon(this, tool, attackedCreature))
			lastAttack = OTSYS_TIME();
	}
	else if(Weapon::useFist(this, attackedCreature))
		lastAttack = OTSYS_TIME();
 
Last edited:
Back
Top