trigger_teleport: change teleported entity's angles while maintaining the same velocity.
This commit is contained in:
parent
89bf3e436a
commit
4a11c91d7d
1 changed files with 8 additions and 0 deletions
|
@ -69,7 +69,15 @@ trigger_teleport::Touch(entity eToucher)
|
|||
|
||||
if (eTarget) {
|
||||
vector endpos = eTarget.origin + [0,0,16];
|
||||
float flSpeed = vlen(eToucher.velocity);
|
||||
makevectors(eToucher.angles);
|
||||
eToucher.velocity = (v_forward * flSpeed);
|
||||
eToucher.angles = eTarget.angles;
|
||||
setorigin_safe(eToucher, endpos);
|
||||
|
||||
if (eToucher.flags & FL_CLIENT)
|
||||
Client_FixAngle(eToucher, eToucher.angles);
|
||||
|
||||
NSLog("^2trigger_teleport::^3Touch^7: Teleported '%s' to `%v`",
|
||||
eToucher.netname, endpos);
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue