mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Replaced _stricmp in previous commit with strcmp.
Minor edits to some code.
This commit is contained in:
@@ -653,10 +653,10 @@ int ret1 - pass -1 to cancel the execution of the handler (only for HOOK_STD
|
||||
|
||||
HOOK_TARGETOBJECT (hs_targetobject.int)
|
||||
|
||||
Runs when the targeting cursor moves over an object, or when the player tries to attack the target object.
|
||||
Runs when the targeting cursor hovers over an object, or when the player tries to attack the target object.
|
||||
You can override the target object or prevent the player from attacking the chosen target.
|
||||
|
||||
int arg1 - event type: 0 - when the cursor moves over the object, 1 - when trying to attack the target object
|
||||
int arg1 - event type: 0 - when the cursor hovers over the object, 1 - when trying to attack the target object
|
||||
int arg2 - 1 when the target object is valid to attack, 0 otherwise
|
||||
Obj arg3 - the target object
|
||||
|
||||
|
||||
@@ -278,7 +278,7 @@ void Drugs::init() {
|
||||
int set = -1;
|
||||
char section[4];
|
||||
for (int i = 1; i <= count; i++) {
|
||||
_itoa_s(i, section, 10);
|
||||
_itoa(i, section, 10);
|
||||
int pid = iniGetInt(section, "PID", 0, iniDrugs);
|
||||
if (pid > 0) {
|
||||
CheckEngineNumEffects(set, pid);
|
||||
|
||||
@@ -127,11 +127,11 @@ static void LoadElevators(const char* elevFile) {
|
||||
elevatorsFrms[i].buttons = iniGetInt(section, "ButtonsFrm", elevatorsFrms[i].buttons, elevFile);
|
||||
char setting[32];
|
||||
for (int j = 0; j < exitsPerElevator; j++) {
|
||||
sprintf_s(setting, "ID%d", j + 1);
|
||||
sprintf(setting, "ID%d", j + 1);
|
||||
elevatorExits[i][j].id = iniGetInt(section, setting, elevatorExits[i][j].id, elevFile);
|
||||
sprintf_s(setting, "Elevation%d", j + 1);
|
||||
sprintf(setting, "Elevation%d", j + 1);
|
||||
elevatorExits[i][j].elevation = iniGetInt(section, setting, elevatorExits[i][j].elevation, elevFile);
|
||||
sprintf_s(setting, "Tile%d", j + 1);
|
||||
sprintf(setting, "Tile%d", j + 1);
|
||||
elevatorExits[i][j].tile = iniGetInt(section, setting, elevatorExits[i][j].tile, elevFile);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -513,7 +513,7 @@ static long __fastcall TargetObjectHook(DWORD isValid, DWORD object, long type)
|
||||
static void __declspec(naked) gmouse_bk_process_hook() {
|
||||
__asm {
|
||||
push 0; // type
|
||||
mov ecx, eax; // 1 - valid (object) or 0 - invalid
|
||||
mov ecx, eax; // 1 - valid(object) or 0 - invalid
|
||||
mov edx, edi; // object under mouse
|
||||
call TargetObjectHook;
|
||||
mov edi, eax;
|
||||
@@ -524,7 +524,7 @@ static void __declspec(naked) gmouse_bk_process_hook() {
|
||||
static void __declspec(naked) gmouse_handle_event_hook() {
|
||||
__asm {
|
||||
push 1; // type
|
||||
mov ecx, eax; // 1 - valid (object) or 0 - invalid
|
||||
mov ecx, eax; // 1 - valid(object) or 0 - invalid
|
||||
cmp dword ptr ds:[targetRet], 0;
|
||||
je default;
|
||||
// override
|
||||
|
||||
@@ -33,12 +33,12 @@ static Delegate<DWORD> onAdjustFid;
|
||||
|
||||
static DWORD sizeLimitMode;
|
||||
static DWORD invSizeMaxLimit;
|
||||
|
||||
static DWORD reloadWeaponKey = 0;
|
||||
static DWORD itemFastMoveKey = 0;
|
||||
static DWORD skipFromContainer = 0;
|
||||
|
||||
void InventoryKeyPressedHook(DWORD dxKey, bool pressed) {
|
||||
// TODO: move this out into a script
|
||||
if (pressed && reloadWeaponKey && dxKey == reloadWeaponKey && IsMapLoaded() && (GetLoopFlags() & ~(COMBAT | PCOMBAT)) == 0) {
|
||||
DWORD maxAmmo, curAmmo;
|
||||
fo::GameObject* item = fo::GetActiveItem();
|
||||
@@ -282,13 +282,13 @@ static const char* _stdcall SizeInfoMessage(fo::GameObject* item) {
|
||||
if (size == 1) {
|
||||
const char* message = fo::MessageSearch(&fo::var::proto_main_msg_file, 543);
|
||||
if (message == nullptr)
|
||||
strncpy_s(SizeMsgBuf, "It occupies 1 unit.", _TRUNCATE);
|
||||
strcpy(SizeMsgBuf, "It occupies 1 unit.");
|
||||
else
|
||||
_snprintf_s(SizeMsgBuf, _TRUNCATE, message, size);
|
||||
strncpy_s(SizeMsgBuf, message, _TRUNCATE);
|
||||
} else {
|
||||
const char* message = fo::MessageSearch(&fo::var::proto_main_msg_file, 542);
|
||||
if (message == nullptr)
|
||||
_snprintf_s(SizeMsgBuf, _TRUNCATE, "It occupies %d units.", size);
|
||||
sprintf(SizeMsgBuf, "It occupies %d units.", size);
|
||||
else
|
||||
_snprintf_s(SizeMsgBuf, _TRUNCATE, message, size);
|
||||
}
|
||||
|
||||
@@ -184,7 +184,7 @@ static void __fastcall game_init_databases_hook1() {
|
||||
|
||||
fo::PathNode* node = fo::var::paths;
|
||||
while (node->next) {
|
||||
if (!_stricmp(node->path, masterPatch)) break;
|
||||
if (!strcmp(node->path, masterPatch)) break;
|
||||
node = node->next;
|
||||
}
|
||||
fo::var::master_db_handle = node; // set pointer to master_patches node
|
||||
|
||||
Reference in New Issue
Block a user