View Issue Details

IDProjectCategoryView StatusLast Update
0008513Multi Theft Auto : San AndreasScriptingpublic2014-09-02 22:06
ReporterGrafuAssigned Tosbx320 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Platform64-bitOSWindowsOS Version8.1 Pro
Product Version 
Target VersionFixed in Version1.4.1 
Summary0008513: Vector metamethod requires specific argument order
Description

crun Vector3(1, 2, 3) * 3 >> OK

crun 3 * Vector3(1, 2, 3) >> WARNING: Bad argument @'__mul' [Expected vector3 at argument 1, got number '3']

This is possibly because the program is missing the check for argument type to decide the correct order.

Steps To Reproduce

crun Vector3(1, 2, 3) 3
crun 3
Vector3(1, 2, 3)

TagsNo tags attached.

Activities

Talidan

2014-09-02 20:21

administrator   ~~0021923

I suspect this is because this operation tries to use the multiply method of the "number" type rather than vector.

qaisjp

2014-09-02 20:22

administrator   ~~0021924

If this was so, Talidan, then we'd receive the inverse of "[Expected vector3 at argument 1, got number '3']
"

sbx320

2014-09-02 20:28

administrator   ~~0021925

Lua math lookup:
1) If both operands are numbers, use the normal way
2) If one of the two operands has a metamethod it uses this method
3) If both operands have a metamethod the first operands's metamethod is called

The first parameter of the metamethod is always the first operand. MTA doesn't account for this, causing this error.

Working on a fix.

sbx320

2014-09-02 22:06

administrator   ~~0021927

Fixed in https://code.google.com/p/mtasa-blue/source/detail?r=6844

Issue History

Date Modified Username Field Change