forked from Mirrors/openclonk
make sword work correctly with gamepad controls
parent
f280c54cd3
commit
1e0deb3ece
|
@ -25,7 +25,7 @@ public func IsToolProduct() { return 1; }
|
||||||
|
|
||||||
local magic_number;
|
local magic_number;
|
||||||
local carry_bone;
|
local carry_bone;
|
||||||
public func ControlUseStart(object clonk, int x, int y)
|
public func ControlUse(object clonk, int x, int y)
|
||||||
{
|
{
|
||||||
// cooldown?
|
// cooldown?
|
||||||
if(!CanStrikeWithWeapon(clonk)) return true;
|
if(!CanStrikeWithWeapon(clonk)) return true;
|
||||||
|
@ -97,13 +97,6 @@ public func ControlUseStart(object clonk, int x, int y)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
func ControlUseStop(object clonk, int x, int y)
|
|
||||||
{
|
|
||||||
//StopWeaponHitCheckEffect(clonk);
|
|
||||||
}
|
|
||||||
|
|
||||||
func OnWeaponHitCheckStop(clonk)
|
func OnWeaponHitCheckStop(clonk)
|
||||||
{
|
{
|
||||||
carry_bone = nil;
|
carry_bone = nil;
|
||||||
|
|
|
@ -24,7 +24,7 @@ protected func AI_SwordAttack(object clonk, int x, int y, object target)
|
||||||
if (dx > 0 && clonk->GetDir() == DIR_Left)
|
if (dx > 0 && clonk->GetDir() == DIR_Left)
|
||||||
clonk->SetDir(DIR_Right);
|
clonk->SetDir(DIR_Right);
|
||||||
|
|
||||||
ControlUseStart(clonk, dx, dy);
|
ControlUse(clonk, dx, dy);
|
||||||
|
|
||||||
clonk->AppendCommand("Wait", nil, 20, nil, nil, nil, 20);
|
clonk->AppendCommand("Wait", nil, 20, nil, nil, nil, 20);
|
||||||
clonk->AppendCommand("Call", clonk, nil, nil, target, nil, "AI_MeleeAttack");
|
clonk->AppendCommand("Call", clonk, nil, nil, target, nil, "AI_MeleeAttack");
|
||||||
|
|
Loading…
Reference in New Issue