Page 1 of 1

Sitting

Posted: Fri Sep 30, 2016 1:11 pm
by Gangrenous
Any way to tell if a client is sitting or standing ? Searched the source and not finding much, my search skills are failing me. I am seeing an opcode, OP_SitMsg and OP_StandMsg, not sure if those have anything to actually do with the client sitting or not.

Re: Sitting

Posted: Fri Sep 30, 2016 1:14 pm
by Jabantiz
There is no flag to check, you might be able to check the visual state of the player and see if it is the sitting animation though.

Re: Sitting

Posted: Fri Sep 30, 2016 1:25 pm
by Gangrenous
Yep, that was a last resort.

Re: Sitting

Posted: Thu Dec 28, 2017 12:42 pm
by Gangrenous
I figured I would follow up on how to check on this.

Code: Select all

if(IsPlayer() && GetTempVisualState() == 540)

Re: Sitting

Posted: Thu Dec 28, 2017 1:41 pm
by tyrbo
You could try using

Code: Select all

client->GetPlayer()->get_character_flag(CF_IS_SITTING);

Re: Sitting

Posted: Sat Apr 13, 2019 6:40 pm
by Gangrenous
Old post but I lost this code and was adding it back in. I did try that Tyrbo, just because it was more natural when coding, but alas it did not seem to work.

Re: Sitting

Posted: Sun Apr 14, 2019 3:19 am
by Ememjr
Well i think we should have a flag for it,
IMO - the client sends meesage to sit, server then sends the code to have the player sit at that time we should set a flag that he is sitting

same with crouch, if we dont have it already we should have a flag for crouchingg since there are spells that say must be crouching

Re: Sitting

Posted: Sun Apr 14, 2019 3:50 am
by Gangrenous
Ememjr wrote: Sun Apr 14, 2019 3:19 am Well i think we should have a flag for it,
IMO - the client sends meesage to sit, server then sends the code to have the player sit at that time we should set a flag that he is sitting

same with crouch, if we dont have it already we should have a flag for crouchingg since there are spells that say must be crouching
Well if you know some kind of hook, let me know. I ended up going into the player loop and checking if the person was sitting or not and flipping a boolean private variable player_sitting. I hated to have to put anything into the player loop, I want to keep that as lean as possible.

Re: Sitting

Posted: Sun Apr 14, 2019 4:45 am
by Ememjr
ill take a look
curious if on live if you are sitting when you exit game, are you sitting or standing up when you come back

Re: Sitting

Posted: Sun Apr 14, 2019 10:47 am
by Cynnar
Standing when you log back in

Re: Sitting

Posted: Sun Apr 14, 2019 1:35 pm
by Ememjr
ok it would be easy enough to add a flag called isSitting to the player, it will defualt to false on login then when i sit command comes from the client to server it will saet that flag to isSitting() = true.

sound good, let me know and ill add it in

Re: Sitting

Posted: Sun Apr 14, 2019 1:45 pm
by Cynnar
Yeah I think we will need it for some things.

Re: Sitting

Posted: Sun Apr 14, 2019 8:54 pm
by tyrbo
You can tell whether or not a player is sitting by checking the activity status of the last movement packet.
It's another bitmask, 64 being the sitting value, at least on AoM.