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:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user