Merge branch 'master' of github.com:ucc/OpenDispense2
[tpg/opendispense2.git] / src / server / handler_door.c
index 5ec25c2..1db954f 100644 (file)
@@ -48,6 +48,7 @@ bool  gbDoor_LockThreadStarted;
 // === CODE ===
 void* Door_Lock(void* Unused __attribute__((unused)))
 {
+       gbDoor_LockThreadStarted = true;
        while(1)
        {
                sem_wait(&gDoor_UnlockSemaphore);
@@ -100,7 +101,7 @@ int Door_CanDispense(int User, int Item)
        // Sanity please
        if( Item != 0 ) return -1;
        
-       if( !(Bank_GetFlags(User) & USER_FLAG_DOORGROUP) )
+       if( !(Bank_GetFlags(User) & (USER_FLAG_DOORGROUP|USER_FLAG_ADMIN)) )
        {
                #if DEBUG
                printf("Door_CanDispense: User %i not in door\n", User);
@@ -128,7 +129,7 @@ int Door_DoDispense(int User, int Item)
        if( Item != 0 ) return -1;
        
        // Check if user is in door
-       if( !(Bank_GetFlags(User) & USER_FLAG_DOORGROUP) )
+       if( !(Bank_GetFlags(User) & (USER_FLAG_DOORGROUP|USER_FLAG_ADMIN)) )
        {
                #if DEBUG
                printf("Door_CanDispense: User %i not in door\n", User);

UCC git Repository :: git.ucc.asn.au