Skip to content

Commit

Permalink
remove (card*)0
Browse files Browse the repository at this point in the history
  • Loading branch information
salix5 committed Nov 21, 2024
1 parent a963493 commit ba096e4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion libduel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1778,7 +1778,7 @@ int32 scriptlib::duel_break_effect(lua_State *L) {
check_action_permission(L);
duel* pduel = interpreter::get_duel_info(L);
pduel->game_field->break_effect();
pduel->game_field->raise_event((card*)0, EVENT_BREAK_EFFECT, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
pduel->game_field->raise_event(nullptr, EVENT_BREAK_EFFECT, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
pduel->game_field->process_instant_event();
return lua_yield(L, 0);
}
Expand Down
14 changes: 7 additions & 7 deletions operations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -600,7 +600,7 @@ int32 field::recover(uint16 step, effect* reason_effect, uint32 reason, uint8 re
pduel->write_buffer8(MSG_RECOVER);
pduel->write_buffer8(playerid);
pduel->write_buffer32(val);
raise_event((card*)0, EVENT_RECOVER, reason_effect, reason, reason_player, playerid, amount);
raise_event(nullptr, EVENT_RECOVER, reason_effect, reason, reason_player, playerid, amount);
process_instant_event();
return FALSE;
}
Expand Down Expand Up @@ -679,7 +679,7 @@ int32 field::pay_lp_cost(uint32 step, uint8 playerid, uint32 cost, uint32 must_p
pduel->write_buffer8(MSG_PAY_LPCOST);
pduel->write_buffer8(playerid);
pduel->write_buffer32(cost);
raise_event((card*)0, EVENT_PAY_LPCOST, core.reason_effect, 0, playerid, playerid, cost);
raise_event(nullptr, EVENT_PAY_LPCOST, core.reason_effect, 0, playerid, playerid, cost);
process_instant_event();
return TRUE;
}
Expand Down Expand Up @@ -765,7 +765,7 @@ int32 field::remove_counter(uint16 step, uint32 reason, card* pcard, uint8 rplay
return FALSE;
}
case 3: {
raise_event((card*)0, EVENT_REMOVE_COUNTER + countertype, core.reason_effect, reason, rplayer, rplayer, count);
raise_event(nullptr, EVENT_REMOVE_COUNTER + countertype, core.reason_effect, reason, rplayer, rplayer, count);
process_instant_event();
return FALSE;
}
Expand Down Expand Up @@ -6432,7 +6432,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
pduel->write_buffer8(core.coin_result[i]);
}
}
raise_event((card*)0, EVENT_TOSS_COIN_NEGATE, reason_effect, 0, reason_player, playerid, count);
raise_event(nullptr, EVENT_TOSS_COIN_NEGATE, reason_effect, 0, reason_player, playerid, count);
process_instant_event();
} else {
solve_continuous(peffect->get_handler_player(), peffect, e);
Expand All @@ -6442,7 +6442,7 @@ int32 field::toss_coin(uint16 step, effect * reason_effect, uint8 reason_player,
return FALSE;
}
case 1: {
raise_event((card*)0, EVENT_TOSS_COIN, reason_effect, 0, reason_player, playerid, core.coin_count);
raise_event(nullptr, EVENT_TOSS_COIN, reason_effect, 0, reason_player, playerid, core.coin_count);
process_instant_event();
return TRUE;
}
Expand Down Expand Up @@ -6489,7 +6489,7 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player,
pduel->write_buffer8(core.dice_result[count1 + i]);
}
}
raise_event((card*)0, EVENT_TOSS_DICE_NEGATE, reason_effect, 0, reason_player, playerid, count1 + (count2 << 16));
raise_event(nullptr, EVENT_TOSS_DICE_NEGATE, reason_effect, 0, reason_player, playerid, count1 + (count2 << 16));
process_instant_event();
} else {
solve_continuous(peffect->get_handler_player(), peffect, e);
Expand All @@ -6499,7 +6499,7 @@ int32 field::toss_dice(uint16 step, effect * reason_effect, uint8 reason_player,
return FALSE;
}
case 1: {
raise_event((card*)0, EVENT_TOSS_DICE, reason_effect, 0, reason_player, playerid, count1 + (count2 << 16));
raise_event(nullptr, EVENT_TOSS_DICE, reason_effect, 0, reason_player, playerid, count1 + (count2 << 16));
process_instant_event();
return TRUE;
}
Expand Down
40 changes: 20 additions & 20 deletions processor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2813,7 +2813,7 @@ int32 field::process_battle_command(uint16 step) {
if(core.attack_target) {
raise_single_event(core.attack_target, 0, EVENT_BATTLE_START, 0, 0, 0, 0, 1);
}
raise_event((card*)0, EVENT_BATTLE_START, 0, 0, 0, 0, 0);
raise_event(nullptr, EVENT_BATTLE_START, 0, 0, 0, 0, 0);
process_single_event();
process_instant_event();
pduel->write_buffer8(MSG_HINT);
Expand Down Expand Up @@ -2850,7 +2850,7 @@ int32 field::process_battle_command(uint16 step) {
core.pre_field[1] = core.attack_target->fieldid_r;
raise_single_event(core.attack_target, 0, EVENT_BATTLE_CONFIRM, 0, 0, 0, 0, 1);
}
raise_event((card*)0, EVENT_BATTLE_CONFIRM, 0, 0, 0, 0, 0);
raise_event(nullptr, EVENT_BATTLE_CONFIRM, 0, 0, 0, 0, 0);
process_single_event();
process_instant_event();
pduel->write_buffer8(MSG_HINT);
Expand Down Expand Up @@ -2880,7 +2880,7 @@ int32 field::process_battle_command(uint16 step) {
raise_single_event(core.attacker, 0, EVENT_PRE_DAMAGE_CALCULATE, 0, 0, 0, 0, 0);
if(core.attack_target)
raise_single_event(core.attack_target, 0, EVENT_PRE_DAMAGE_CALCULATE, 0, 0, 0, 0, 1);
raise_event((card*)0, EVENT_PRE_DAMAGE_CALCULATE, 0, 0, 0, 0, 0);
raise_event(nullptr, EVENT_PRE_DAMAGE_CALCULATE, 0, 0, 0, 0, 0);
process_single_event();
process_instant_event();
pduel->write_buffer8(MSG_HINT);
Expand Down Expand Up @@ -3118,7 +3118,7 @@ int32 field::process_battle_command(uint16 step) {
raise_single_event(core.attacker, 0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0);
if(core.attack_target)
raise_single_event(core.attack_target, 0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 1);
raise_event((card*)0, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0);
raise_event(nullptr, EVENT_BATTLED, 0, 0, PLAYER_NONE, 0, 0);
process_single_event();
process_instant_event();
if(core.effect_damage_step) {
Expand Down Expand Up @@ -3188,7 +3188,7 @@ int32 field::process_battle_command(uint16 step) {
raise_single_event(core.attacker, 0, EVENT_DAMAGE_STEP_END, 0, 0, 0, 0, 0);
if(core.attack_target)
raise_single_event(core.attack_target, 0, EVENT_DAMAGE_STEP_END, 0, 0, 0, 0, 1);
raise_event((card*)0, EVENT_DAMAGE_STEP_END, 0, 0, 0, 0, 0);
raise_event(nullptr, EVENT_DAMAGE_STEP_END, 0, 0, 0, 0, 0);
process_single_event();
process_instant_event();
core.attacker->set_status(STATUS_BATTLE_DESTROYED, FALSE);
Expand Down Expand Up @@ -3742,7 +3742,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
infos.phase = PHASE_DRAW;
core.phase_action = FALSE;
core.hand_adjusted = FALSE;
raise_event((card*)0, EVENT_PHASE_START + PHASE_DRAW, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PHASE_START + PHASE_DRAW, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
Expand All @@ -3760,7 +3760,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
}
pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer16(infos.phase);
raise_event((card*)0, EVENT_PREDRAW, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PREDRAW, 0, 0, 0, turn_player, 0);
process_instant_event();
pduel->write_buffer8(MSG_HINT);
pduel->write_buffer8(HINT_EVENT);
Expand Down Expand Up @@ -3802,7 +3802,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
}
pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer16(infos.phase);
raise_event((card*)0, EVENT_PHASE_START + PHASE_STANDBY, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PHASE_START + PHASE_STANDBY, 0, 0, 0, turn_player, 0);
process_instant_event();
return FALSE;
}
Expand All @@ -3817,7 +3817,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
//Main1
infos.phase = PHASE_MAIN1;
core.phase_action = FALSE;
raise_event((card*)0, EVENT_PHASE_START + PHASE_MAIN1, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PHASE_START + PHASE_MAIN1, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
Expand Down Expand Up @@ -3858,7 +3858,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
adjust_all();
return FALSE;
}
raise_event((card*)0, EVENT_PHASE_START + PHASE_BATTLE_START, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PHASE_START + PHASE_BATTLE_START, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
Expand Down Expand Up @@ -3905,7 +3905,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
//Main2
infos.phase = PHASE_MAIN2;
core.phase_action = FALSE;
raise_event((card*)0, EVENT_PHASE_START + PHASE_MAIN2, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PHASE_START + PHASE_MAIN2, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
Expand Down Expand Up @@ -3938,7 +3938,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
}
pduel->write_buffer8(MSG_NEW_PHASE);
pduel->write_buffer16(infos.phase);
raise_event((card*)0, EVENT_PHASE_START + PHASE_END, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_PHASE_START + PHASE_END, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
Expand All @@ -3957,7 +3957,7 @@ int32 field::process_turn(uint16 step, uint8 turn_player) {
return FALSE;
}
case 18: {
raise_event((card*)0, EVENT_TURN_END, 0, 0, 0, turn_player, 0);
raise_event(nullptr, EVENT_TURN_END, 0, 0, 0, turn_player, 0);
process_instant_event();
adjust_all();
return FALSE;
Expand Down Expand Up @@ -4364,7 +4364,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
pduel->write_buffer8(cait->chain_count);
add_to_disable_check_list(cait->triggering_effect->get_handler());
adjust_instant();
raise_event((card*)0, EVENT_CHAIN_ACTIVATING, cait->triggering_effect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
raise_event(nullptr, EVENT_CHAIN_ACTIVATING, cait->triggering_effect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
process_instant_event();
return FALSE;
}
Expand All @@ -4378,15 +4378,15 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
check_chain_counter(peffect, cait->triggering_player, cait->chain_count, true);
core.new_fchain.remove_if([chaincount = cait->chain_count](chain ch) { return ch.evt.event_code == EVENT_CHAINING && ch.evt.event_value == chaincount; });
core.new_ochain.remove_if([chaincount = cait->chain_count](chain ch) { return ch.evt.event_code == EVENT_CHAINING && ch.evt.event_value == chaincount; });
raise_event((card*)0, EVENT_CHAIN_NEGATED, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
raise_event(nullptr, EVENT_CHAIN_NEGATED, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
process_instant_event();
core.units.begin()->step = 9;
return FALSE;
}
release_oath_relation(peffect);
break_effect();
core.chain_solving = TRUE;
raise_event((card*)0, EVENT_CHAIN_SOLVING, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
raise_event(nullptr, EVENT_CHAIN_SOLVING, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
process_instant_event();
return FALSE;
}
Expand Down Expand Up @@ -4416,7 +4416,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
pduel->write_buffer8(MSG_CHAIN_DISABLED);
pduel->write_buffer8(cait->chain_count);
}
raise_event((card*)0, EVENT_CHAIN_DISABLED, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
raise_event(nullptr, EVENT_CHAIN_DISABLED, peffect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
process_instant_event();
core.units.begin()->step = 3;
return FALSE;
Expand Down Expand Up @@ -4466,7 +4466,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
core.conti_player = PLAYER_NONE;
pduel->write_buffer8(MSG_CHAIN_SOLVED);
pduel->write_buffer8(cait->chain_count);
raise_event((card*)0, EVENT_CHAIN_SOLVED, cait->triggering_effect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
raise_event(nullptr, EVENT_CHAIN_SOLVED, cait->triggering_effect, 0, cait->triggering_player, cait->triggering_player, cait->chain_count);
adjust_disable_check_list();
process_instant_event();
core.units.begin()->step = 9;
Expand Down Expand Up @@ -4550,7 +4550,7 @@ int32 field::solve_chain(uint16 step, uint32 chainend_arg1, uint32 chainend_arg2
return FALSE;
}
case 13: {
raise_event((card*)0, EVENT_CHAIN_END, 0, 0, 0, 0, 0);
raise_event(nullptr, EVENT_CHAIN_END, 0, 0, 0, 0, 0);
process_instant_event();
adjust_all();
if(chainend_arg1 != 0x101 || chainend_arg2 != TRUE) {
Expand Down Expand Up @@ -5104,7 +5104,7 @@ int32 field::adjust_step(uint16 step) {
return FALSE;
}
case 15: {
raise_event((card*)0, EVENT_ADJUST, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
raise_event(nullptr, EVENT_ADJUST, 0, 0, PLAYER_NONE, PLAYER_NONE, 0);
process_instant_event();
return FALSE;
}
Expand Down

0 comments on commit ba096e4

Please sign in to comment.