File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -15910,20 +15910,22 @@ static BUILDIN(npctalk)
1591015910// change npc walkspeed [Valaris]
1591115911static BUILDIN(npcspeed)
1591215912{
15913- struct npc_data* nd;
15914- int speed;
15915-
15916- speed = script_getnum(st,2);
15917- nd = map->id2nd(st->oid);
15913+ struct npc_data *nd = map->id2nd(st->oid);
15914+ int speed = script_getnum(st, 2);
1591815915
1591915916 if (nd != NULL) {
1592015917 unit->bl2ud2(&nd->bl); // ensure nd->ud is safe to edit
15918+ if (nd->ud == NULL) {
15919+ ShowWarning("buildin_npcspeed: floating NPC don't have unit data.\n");
15920+ return false;
15921+ }
1592115922 nd->speed = speed;
1592215923 nd->ud->state.speed_changed = 1;
1592315924 }
1592415925
1592515926 return true;
1592615927}
15928+
1592715929// make an npc walk to a position [Valaris]
1592815930static BUILDIN(npcwalkto)
1592915931{
You can’t perform that action at this time.
0 commit comments