-
-
Notifications
You must be signed in to change notification settings - Fork 203
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update func_vehicle
for multiplayer
#737
Conversation
@s1lentq Хотим на сервер карт с машинами залить типа big_city2 всем нравятся карты, даже пусть физика у машин не самая лучшая))) но вот некоторые проблемы сильно мешают использовать такие карты на сервере! В общем на картах с машинами невозможно играть по двум причинам... 1 - это убийство своих. Тут все решается. |
func_vehicle
for multiplayer
Co-authored-by: Sergey Shorokhov <[email protected]>
Co-authored-by: Sergey Shorokhov <[email protected]>
Так же если заметили отключил m_pDriver = nullptr когда игрок отключает управление машиной, что это дает, видно на последнем видео. |
I am not sure that these changes will be the correct behavior for the entity. Because, in actuality, the entity ALWAYS does not have a driver after the player has left the vehicle. And this is the correct behavior for GameDLL. If you want the gameplay to consider a kill from the vehicle after the player has left it, you need to handle this as a specific case. |
In multiplayer need known who is latest driver for give frag him. Ну смысл данного квара что бы сделать все иначе чем в оригинале, в общем если я правильно понял включил проверку на mp_legacy_vehicle_block в данные изменения, теперь все устраивает ? :( Так же заметил что при выходе игрока m_pDriver не устанавливался в NULLPTR и добавил это в ClientDisconnected. Правильно ли я сделал? Или это избыточная проверка и ничего не случилось бы? (Допустим игрок пишет disconnect во время разгона, и автомобиль убивает что-нибудь, m_pDriver все еще будет указывать на этого игрока. И не знаю к чему это приведет, по этому на всякий случай добавил очистку в ClientDisconnected, хотя ее изначально нет в GameDLL) |
I think, there shouldn't be a problem with it. Just in case we could add has_disconnected check |
@hajimura but m_pDriver is not nullptr! This check not works in this case, because m_pDriver not nullptr if player disconnected. @wopox1337 Now all okay or need some more changes ? |
|
has_disconnected not require valid CBasePlayer struct ? or this class not deleted after player disconnect? |
Waiting for @s1lentq review |
Yep. Slot that was released after player disconnect still has CBasePlayer class, just sets FL_DORMANT flag (https://github.com/s1lentq/ReGameDLL_CS/blob/master/regamedll/dlls/cbase.cpp#L844-L854) and he updates after player connect |
@hajimura if player disconnected, but in this time, connected another player ? yes, this is very rary case, i think your variant is better |
🚢 |
Thanks to #737 (comment) help!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think all okay
The new functionality needs to be introduced in a different way. At least this way: CFuncVehicle::m_hLastDriver;
EntityHandle<CBaseEntity> m_hLastDriver; and need to think better about the CVar name |
This comment was marked as off-topic.
This comment was marked as off-topic.
This comment was marked as abuse.
This comment was marked as abuse.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
* Update func_vehicle for multiplayer. Added mp_legacy_vehicle_block cvar. * Update dist/game.cfg Co-authored-by: Sergey Shorokhov <[email protected]> * Update regamedll/dlls/game.cpp Co-authored-by: Sergey Shorokhov <[email protected]> * Fix default behavior * Optimization Thanks to #737 (comment) help! * Update README.md Co-authored-by: Sergey Shorokhov <[email protected]>
mp_legacy_vehicle_block
.Video desc:
https://www.youtube.com/watch?v=2UbD5JGc7xs
https://www.youtube.com/watch?v=yQ1E9JvosDA
(Save m_pDriver)