NeotokyoRebuild / neo

NEOTOKYO Rebuild - Source SDK 2013 mod of NEOTOKYO
Other
11 stars 9 forks source link

Backstabs #404

Closed AdamTadeusz closed 1 week ago

AdamTadeusz commented 1 week ago

Description

Toolchain

Linked Issues

AdamTadeusz commented 1 week ago

@Rainyan do you think the compiler is smart enough to reduce (100 * (1 / NEO_SUPPORT_DAMAGE_MODIFIER)) + 1) to a single value or should that be another constexpr too?

Rainyan commented 1 week ago

@Rainyan do you think the compiler is smart enough to reduce (100 * (1 / NEO_SUPPORT_DAMAGE_MODIFIER)) + 1) to a single value or should that be another constexpr too?

Almost certainly the compiler will calculate that at compile time. But doesn't hurt to constexpr it if we can.

AdamTadeusz commented 1 week ago

@Rainyan do you think the compiler is smart enough to reduce (100 * (1 / NEO_SUPPORT_DAMAGE_MODIFIER)) + 1) to a single value or should that be another constexpr too?

Almost certainly the compiler will calculate that at compile time. But doesn't hurt to constexpr it if we can.

Also it would be easier to understand what thats there for, magic numbers and all that

Rainyan commented 1 week ago

@Rainyan do you think the compiler is smart enough to reduce (100 * (1 / NEO_SUPPORT_DAMAGE_MODIFIER)) + 1) to a single value or should that be another constexpr too?

Almost certainly the compiler will calculate that at compile time. But doesn't hurt to constexpr it if we can.

Also it would be easier to understand what thats there for, magic numbers and all that

Yeah, feel free to refactor it if you want.

AdamTadeusz commented 1 week ago

I tested again after refactoring, and at 36.87 degrees the bots sometimes die and sometimes not. Im guessing this testing methodology isn't ideal (running setang 0 90 0 multiple times with a different starting orientation each time results in different calculated attack angles, differences in the hundredths of a degree) so Ill just blame it on that and leave it as is