static void KUSB_API Cleanup_OvlK(PKOVL_HANDLE_INTERNAL handle) { PoolHandle_Dead_OvlK(handle); SafeCloseEvent(handle->Overlapped.hEvent); if (handle->Pool) { if (DecLock(handle->Pool->MasterListCount) == 0) { Mem_Free(&handle->Pool->MasterArray); handle->Pool->AcquiredList = NULL; handle->Pool->ReleasedList = NULL; handle->Pool->MasterListCount = 0; handle->Pool->MasterArray = NULL; } handle->Pool = NULL; } }
inline BcdCriticalBlock() { DecLock(); mark = DecMarkStack(); }
void OneObject::MakeMeFly(word MagID){ if(MagID==0xFFFF||Media==2)return; if(!Ref.General->CanFly)return; MagSrcID=MagID; int cx=x>>2; int cy=y>>2; ClearOrders(); if(InLineCom)FreeAsmLink(); FlyCell* FC=&FlyMap[cy][cx]; if(FC->NFly>=15)return; //Deleting from the terra if(LLock[y][x])DecLock(x,y); LLock[y][x]=0; Mops[y][x]=0xFFFF; int Rex=(x<<9)+256; int Rey=(y<<9)+256; for(int k=0;FC->FlyList[k]!=0xFFFF;k++); FC->NFly++; FC->FlyList[k]=Index; //Cell8x8* CELL=&TCInf[NNUM][y>>2][x>>2]; //OneObject* G=Group[i]; //GeneralObject* GO=Mon[n]; //CELL->UnitsAmount[GO->Kind]++; //G->DefaultSettings(GO); //G->Teleport=false; //G->capTeleport=GO->Teleport; RealX=Rex; RealY=Rey; DestX=Rex; DestY=Rey; RealVx=0; RealVy=-128; RealDir=((Direction<<5)+16)&255; Media=2; OnWater=false; Ready=true; delay=0; NearBase=0xFFFF; memset(&(ARegs),0,sizeof ARegs); LoadAnimation(0,0,0); LoadCurAnm(0); LocalOrder=NULL; PrioryLevel=0; InLineCom=NULL; LineOffset=0; Ticks=0; Addx=0; Addy=0; Npush=0; StandTime=100; Sdoxlo=false; EnemyDist=5000; Attack=false; EnemyID=0xFFFF; Egoist=false; Height=0; LoadAnimation(0,0,0);//stand=motion animation LoadAnimation(1,2,0);//attack LoadAnimation(2,3,0);//death BestDist=32*16*6; FlyAttackMode=false; };
BcdCriticalBlock() { DecLock(); }