Vector.length - can only set int values?

Please post any questions about developing your plugin here. Please use the search function before posting!
User avatar
iPlayer
Developer
Posts: 590
Joined: Sat Nov 14, 2015 8:37 am
Location: Moscow
Contact:

Vector.length - can only set int values?

Postby iPlayer » Tue Oct 25, 2016 4:22 pm

Hey there,

I've come across a fact that the Vector's length property only accepts integer values:
/src/core/modules/mathlib/mathlib.h#L47

Trying to do something like

Syntax: Select all

speed_cap = 32.0
velocity = player.velocity
velocity.length = speed_cap

raises Boost.Python.ArgumentError

Is this intended and I should change my plugin?
Image /id/its_iPlayer
My plugins: Map Cycle • Killstreaker • DeadChat • Infinite Jumping • TripMines • AdPurge • Bot Damage • PLRBots • Entity AntiSpam

Hail, Companion. [...] Hands to yourself, sneak thief. Image
User avatar
Ayuto
Project Leader
Posts: 2193
Joined: Sat Jul 07, 2012 8:17 am
Location: Germany

Re: Vector.length - can only set int values?

Postby Ayuto » Tue Oct 25, 2016 5:01 pm

Oops, you are right. It should be float. :grin:
User avatar
L'In20Cible
Project Leader
Posts: 1533
Joined: Sat Jul 14, 2012 9:29 pm
Location: Québec

Re: Vector.length - can only set int values?

Postby L'In20Cible » Tue Oct 25, 2016 7:03 pm

Fixed in 2315e41, thank you for reporting!

Return to “Plugin Development Support”

Who is online

Users browsing this forum: No registered users and 24 guests