- case "name": trace_ent.netname = strzone(strdecolorize(argv(2))); if(trace_ent.sprite) WaypointSprite_UpdateSprites(trace_ent.sprite, trace_ent.netname, "", ""); break;
- case "skin": trace_ent.skin = stof(argv(2)); trace_ent.SendFlags |= MSF_STATUS; break;
- case "movetarget": trace_ent.monster_moveflags = stof(argv(2)); break;
- default: sprint(self, "Unknown parameter\n"); break;
+ makevectors(self.v_angle);
+ WarpZone_TraceLine(self.origin + self.view_ofs, self.origin + self.view_ofs + v_forward * 100, MOVE_NORMAL, self);
+
+ if(!autocvar_g_monsters_edit) { sprint(self, "Monster property editing is not enabled.\n"); }
+ if(!(trace_ent.flags & FL_MONSTER)) { sprint(self, "You need to aim at your monster to edit its properties.\n"); }
+ else if(trace_ent.realowner != self) { sprint(self, "That monster does not belong to you.\n"); }
+ else // all went well, continue
+ {
+ switch(argv(1))
+ {
+ case "skin":
+ {
+ if(trace_ent.monsterid != MON_MAGE)
+ trace_ent.skin = stof(argv(2));
+ break;
+ }
+ case "movetarget":
+ {
+ trace_ent.monster_moveflags = stof(argv(2));
+ break;
+ }
+ }
+ }
+
+ return;