Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
 * +/- 1 frame tolerance for sus suicide calculation
  • Loading branch information
a-sync committed Mar 24, 2024
1 parent d962184 commit 307ab67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions application/controllers/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ public function __construct()
{
parent::__construct();
$this->output->set_header('X-Powered-By: 🐹🐹');
// $this->output->enable_profiler(TRUE); // DEBUG

$this->load->library('session');

Expand Down
8 changes: 4 additions & 4 deletions application/models/Additional_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -629,11 +629,11 @@ public function get_ops_to_fix_data($verified = false, $op_ids_with_unambiguous_
FROM events AS e
INNER JOIN entities AS victim ON victim.aid = e.victim_aid
LEFT JOIN (
SELECT ee.operation_id, ee.victim_id, ee.frame
SELECT ee.operation_id, ee.victim_id, ee.frame, (ee.frame + 1) AS frame_plus, (GREATEST(ee.frame, 1) - 1) AS frame_minus
FROM events AS ee
WHERE ee.victim_id = ee.attacker_id AND ee.victim_id IS NOT NULL AND ee.event = 'hit'
GROUP BY ee.operation_id, ee.victim_id
) AS hits ON hits.operation_id = e.operation_id AND hits.victim_id = e.victim_id AND (hits.frame = e.frame OR hits.frame = e.frame - 1 OR hits.frame = e.frame + 1)
) AS hits ON hits.operation_id = e.operation_id AND hits.victim_id = e.victim_id AND (hits.frame = e.frame OR hits.frame_plus = e.frame OR hits.frame_minus = e.frame)
WHERE e.victim_aid = e.attacker_aid AND hits.victim_id IS NULL AND victim.is_player = 1 AND e.event = 'killed'
) AS sus_suicide_events
GROUP BY sus_suicide_events.operation_id
Expand Down Expand Up @@ -664,11 +664,11 @@ public function get_op_sus_suicides($id)
$this->db->select('e.id')
->from('events AS e')
->join('entities AS victim', 'victim.aid = e.victim_aid')
->join("(SELECT ee.operation_id, ee.victim_id, frame
->join("(SELECT ee.operation_id, ee.victim_id, ee.frame, (ee.frame + 1) AS frame_plus, (GREATEST(ee.frame, 1) - 1) AS frame_minus
FROM events AS ee
WHERE ee.victim_id = ee.attacker_id AND ee.victim_id IS NOT NULL AND ee.event = 'hit'
GROUP BY ee.operation_id, ee.victim_id
) AS hits", 'hits.operation_id = e.operation_id AND hits.victim_id = e.victim_id AND (hits.frame = e.frame OR hits.frame = e.frame - 1 OR hits.frame = e.frame + 1)', 'LEFT')
) AS hits", 'hits.operation_id = e.operation_id AND hits.victim_id = e.victim_id AND (hits.frame = e.frame OR hits.frame_plus = e.frame OR hits.frame_minus = e.frame)', 'LEFT')
->where("e.victim_aid = e.attacker_aid AND hits.victim_id IS NULL AND victim.is_player = 1 AND e.event = 'killed'")
->where('e.operation_id', $id);

Expand Down

0 comments on commit 307ab67

Please sign in to comment.