Changeset 1161 for Daodan/src/Patches
- Timestamp:
- Oct 24, 2021, 4:50:22 AM (3 years ago)
- Location:
- Daodan/src/Patches
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Daodan/src/Patches/BSL.c
r995 r1161 431 431 typedef struct { 432 432 char Name[16]; 433 int Bit;433 uint64_t Bit; 434 434 } KeyBit; 435 435 436 KeyBit Actions1[32] = {436 static KeyBit Actions[] = { 437 437 {"Escape", Action_Escape}, 438 438 {"Console", Action_Console}, … … 445 445 {"F7", Action_F7 }, 446 446 {"F8", Action_F8 }, 447 {"StartRecord", Action_StartRecord }, 448 {"StopRecord", Action_StopRecord }, 449 {"PlayRecord", Action_PlayRecord }, 447 {"StartRecord", Action_StartRecord }, 448 {"StopRecord", Action_StopRecord }, 449 {"PlayRecord", Action_PlayRecord }, 450 450 {"F12", Action_F12 }, 451 {"Unknown1", Action_Unknown1 },452 451 {"LookMode", Action_LookMode }, 453 {"Screenshot", Action_Screenshot }, 454 {"Unknown2", Action_Unknown2 }, 455 {"Unknown3", Action_Unknown3 }, 456 {"Unknown4", Action_Unknown4 }, 457 {"Unknown5", Action_Unknown5 }, 452 {"Screenshot", Action_Screenshot }, 458 453 {"Forward", Action_Forward }, 459 454 {"Backward", Action_Backward }, … … 466 461 {"Punch",Action_Punch }, 467 462 {"Kick", Action_Kick }, 468 {"Block", Action_Block } 463 {"Block", Action_Block }, 464 {"Walk", Action_Walk}, 465 {"Action", Action_Action}, 466 {"Hypo", Action_Hypo}, 467 {"Reload", Action_Reload }, 468 {"Swap", Action_Swap }, 469 {"Drop", Action_Drop }, 470 {"Fire1", Action_Fire1 }, 471 {"Fire2", Action_Fire2 }, 472 {"Fire3", Action_Fire3 } 469 473 }; 470 474 471 KeyBit Actions2[9] = {472 {"Walk", Action2_Walk},473 {"Action", Action2_Action},474 {"Hypo", Action2_Hypo},475 {"Reload", Action2_Reload },476 {"Swap", Action2_Swap },477 {"Drop", Action2_Drop },478 {"Fire1", Action2_Fire1 },479 {"Fire2", Action2_Fire2 },480 {"Fire3", Action2_Fire3 }481 };482 475 uint16_t ONICALL bsl_holdkey(sl_callinfo* callinfo, uint32_t numargs, sl_arg args[], int* dontuse1, int* dontuse2, sl_arg* ret) 483 476 { … … 485 478 uint32_t i = 2; 486 479 uint32_t j = 0; 487 int Input1 = 0; 488 int Input2 = 0; 480 uint64_t Input = 0; 489 481 Character* Chr; 490 482 ActiveCharacter* Active; … … 498 490 for(i = 1; i < numargs - 1; i++) { 499 491 for(j = 0; j < 32; j++) { 500 if(!strcmp(args[i].val.value_str32, Actions 1[j].Name)) {501 Input 1 = Input1 | Actions1[j].Bit;492 if(!strcmp(args[i].val.value_str32, Actions[j].Name)) { 493 Input = Input | Actions[j].Bit; 502 494 } 503 495 } 504 for(j = 0; j < 9; j++) { 505 if(!strcmp(args[i].val.value_str32, Actions2[j].Name)) { 506 Input2 = Input2 | Actions2[j].Bit; 507 } 508 } 509 } 510 Active->Input.Current.Actions1 = Active->Input.Current.Actions1 | Input1; 511 Active->Input.Current.Actions2 = Active->Input.Current.Actions2 | Input2; 512 if( Input1 + Input2 == 0 ) { 496 } 497 Active->Input.ActionsDown = Active->Input.ActionsDown | Input; 498 if( Input == 0 ) { 513 499 DDrConsole_PrintF("Func \"%s\", File \"%s\", Line %d: semantic error, \"%s\": No valid keys given.", callinfo->name, callinfo->calllocation, callinfo->linenumber, callinfo->name); 514 500 return 0; … … 537 523 uint32_t i = 2; 538 524 uint32_t j = 0; 539 int Input1 = 0; 540 int Input2 = 0; 525 uint64_t Input = 0; 541 526 for(i = 0; i < numargs; i++) { 542 527 for(j = 0; j < 32; j++) { 543 528 //DDrConsole_PrintF("Testing %s against %s 0x%x", args[i].val.value_str32, Actions1[j].Name, Actions1[j].Bit); 544 if(!strcmp(args[i].val.value_str32, Actions 1[j].Name)) {545 Input 1 = Input1 | Actions1[j].Bit;529 if(!strcmp(args[i].val.value_str32, Actions[j].Name)) { 530 Input = Input | Actions[j].Bit; 546 531 //DDrConsole_PrintF("Success!"); 547 532 } 548 549 } 550 for(j = 0; j < 9; j++) { 551 if(!strcmp(args[i].val.value_str32, Actions2[j].Name)) Input2 = Input2 | Actions2[j].Bit; 552 533 553 534 } 554 535 } … … 556 537 ret->val.value_int32 = 0; 557 538 ret->type = sl_int32; 558 if ( (ONgGameState->Input.Current.Actions1 == Input1) && (ONgGameState->Input.Current.Actions2 == Input2)) ret->val.value_int32 = 1;539 if (ONgGameState->Input.ActionsDown == Input) ret->val.value_int32 = 1; 559 540 return 0; 560 541 } … … 573 554 int i = 2; 574 555 int j = 0; 575 int Input1 = 0; 576 int Input2 = 0; 556 uint64_t Input = 0; 577 557 /* 578 558 numargs = 0; … … 589 569 for(j = 0; j < 32; j++) { 590 570 //DDrConsole_PrintF("Testing %s against %s 0x%x", args[i].val.value_str32, Actions1[j].Name, Actions1[j].Bit); 591 if(!strcmp(args[i].val.value_str32, Actions 1[j].Name)) {592 Input 1 = Input1 | Actions1[j].Bit;571 if(!strcmp(args[i].val.value_str32, Actions[j].Name)) { 572 Input = Input | Actions[j].Bit; 593 573 //DDrConsole_PrintF("Success!"); 594 574 } 595 596 } 597 for(j = 0; j < 9; j++) { 598 if(!strcmp(args[i].val.value_str32, Actions2[j].Name)) Input2 = Input2 | Actions2[j].Bit; 599 575 600 576 } 601 577 // } 602 578 DDrConsole_PrintF("Waiting..."); 603 if ( 604 (( ONgGameState->Input.Current.Actions1 & Input1) == Input1) && 605 (( ONgGameState->Input.Current.Actions2 & Input2) == Input2) 606 ) 579 if (( ONgGameState->Input.ActionsDown & Input) == Input) 607 580 { 608 581 DDrConsole_PrintF("Found key!"); -
Daodan/src/Patches/Utility.c
r994 r1161 122 122 COtTextArea* cons = *(COtTextArea**)0x00571B74; 123 123 char* clipboardText = 0; 124 if(ONgGameState->Input. Current.Actions1& Action_Console && GetKeyState(0x56) & 0x80 && GetKeyState(VK_CONTROL) & 0x80 )124 if(ONgGameState->Input.ActionsDown & Action_Console && GetKeyState(0x56) & 0x80 && GetKeyState(VK_CONTROL) & 0x80 ) 125 125 { 126 126 if(cons && cons->text_entries && cons->num_text_entries)
Note:
See TracChangeset
for help on using the changeset viewer.