fix direction for moving entities by scrollwheel

the same mousewheel direction now always moves an entity away from or
towards the player

  entproperty

    if 100 is added to the attribute index parameter, the sign of the
    increment value is changed

  editaxis

    returns a value for the main axis of player orientation (X:11, Y:12,
    Z:13) and adds 100 if the player is looking in the negative
    direction of the axis

DOCREF entproperty editaxis
This commit is contained in:
ac-stef
2017-07-15 17:27:55 +02:00
parent 59c3d1756d
commit 8bb71ee839
2 changed files with 9 additions and 8 deletions
+3 -2
View File
@@ -198,12 +198,13 @@ COMMANDF(getclosestent, "", () { intret(closestent()); });
void entproperty(int *prop, float *famount, int *unscaled)
{
int n = closestent();
int n = closestent(), amount = *prop >= 100 ? -1 : 1;
*prop %= 100;
if(n < 0) return;
entity &e = ents[n];
int old_a1 = e.attr1;
int t = e.type < MAXENTTYPES ? e.type : 0;
int amount = int(*famount * (*prop >= 0 && *prop < 7 && !*unscaled ? entscale[t][*prop] : 1));
amount *= int(*famount * (*prop >= 0 && *prop < 7 && !*unscaled ? entscale[t][*prop] : 1));
switch(*prop)
{