mob that is not sentinel

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 3 weeks ago #7966 by JTP
mob that is not sentinel was created by JTP
Ok We all know sentinel mobs cant move.

Iwe made a POS_FLYING State and it works perfectly for players. But If a mob is POS_FLYING Then i doesnt move on its own...How ever i Can switch into it and move just fine.

So what am i missing so a mob Will still move when its POS_FLYING ?

Please Log in or Create an account to join the conversation.

More
3 years 3 weeks ago #7968 by thomas

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 3 weeks ago #7971 by JTP
Replied by JTP on topic mob that is not sentinel
&& (GET_POS(ch) == POS_STANDING || GET_POS(ch) == POS_FLYING) &&

Or

&& ((GET_POS(ch) == POS_STANDING) || (GET_POS(ch) == POS_FLYING)) &&

Please Log in or Create an account to join the conversation.

More
3 years 3 weeks ago #7972 by lacrc
Replied by lacrc on topic mob that is not sentinel
Just my opinion here but if POS_STANDING is still 8 and you added POS_FLYING after with the value of 9 then you can simply do:
(GET_POS(ch) >= POS_STANDING)
That way you also cover your bases for other different non movement impairing positions in the future (plus it's only one condition :D)

Please Log in or Create an account to join the conversation.

More
3 years 3 weeks ago #7974 by thomas
Replied by thomas on topic mob that is not sentinel

&& (GET_POS(ch) == POS_STANDING || GET_POS(ch) == POS_FLYING) &&

Or

&& ((GET_POS(ch) == POS_STANDING) || (GET_POS(ch) == POS_FLYING)) &&

Did you try both?
I mean, they're pretty similar, so you could try one and then see if it works.

Please Log in or Create an account to join the conversation.

  • JTP
  • Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
More
3 years 3 weeks ago #7976 by JTP
Replied by JTP on topic mob that is not sentinel
Well now there are also the >= POS_STANDING suggestion, that also works.

Many ways seems to work, Just thought there might be a best practice of doing it, that i might as well learn to do.

Please Log in or Create an account to join the conversation.

More
3 years 3 weeks ago #7977 by thomas
Replied by thomas on topic mob that is not sentinel
Several other places we're using the >= POS_STANDING check, but it's really a (really, really old) hack - it makes the check dependent on the order of positions. This, in turn, makes it harder to add a new one (default position is saved to mob files, so we can't just renumber them).

So either one of the first two would be better.
The following user(s) said Thank You: JTP

Please Log in or Create an account to join the conversation.

Time to create page: 0.103 seconds