mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-24 05:10:42 -04:00
if flying is disabled and you are using scrolled out third person camera, immediately reset scroll distance to default instead of when next time user tries to scroll (Thanks Goodly)
This commit is contained in:
parent
bc33bfb686
commit
70ffe98149
@ -230,9 +230,12 @@ static void OnRawMovement(void* obj, float deltaX, float deltaY) {
|
||||
Camera.Active->OnRawMovement(deltaX, deltaY);
|
||||
}
|
||||
|
||||
static void Camera_CheckThirdPerson(void* obj) {
|
||||
static void OnHacksChanged(void* obj) {
|
||||
struct HacksComp* h = &LocalPlayer_Instance.Hacks;
|
||||
/* Leave third person if not allowed anymore */
|
||||
if (!h->CanUseThirdPerson || !h->Enabled) Camera_CycleActive();
|
||||
/* Check if third person camers is allowed to be scrolled out */
|
||||
if (Camera.Active->isThirdPerson) ThirdPersonCamera_Zoom(0);
|
||||
}
|
||||
|
||||
void Camera_Init(void) {
|
||||
@ -242,7 +245,7 @@ void Camera_Init(void) {
|
||||
|
||||
Camera.Active = &cam_FirstPerson;
|
||||
Event_Register_(&PointerEvents.RawMoved, NULL, OnRawMovement);
|
||||
Event_Register_(&UserEvents.HackPermissionsChanged, NULL, Camera_CheckThirdPerson);
|
||||
Event_Register_(&UserEvents.HackPermissionsChanged, NULL, OnHacksChanged);
|
||||
|
||||
#ifdef CC_BUILD_WIN
|
||||
Camera.Sensitivity = Options_GetInt(OPT_SENSITIVITY, 1, 200, 40);
|
||||
|
Loading…
x
Reference in New Issue
Block a user