fix verband gefangene

This commit is contained in:
2019-02-19 00:29:30 +01:00
parent 722ab5ec61
commit c1602189ac
3 changed files with 36 additions and 14 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Feb 18 2019 21:47:15 GMT+0100 (CET)*/ /*Generated on:Tue Feb 19 2019 00:29:30 GMT+0100 (CET)*/
var AutomaticDispose_Branch = "master"; var AutomaticDispose_Branch = "master";
var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/"; var AutomaticDispose_URL = "https://jf.git.rest/Jomaar/automatic-dispose/raw/branch/";
var da_lss_adis_time = new Date().getTime(); var da_lss_adis_time = new Date().getTime();
+18 -7
View File
@@ -1,4 +1,4 @@
/*Generated on:Mon Feb 18 2019 21:47:15 GMT+0100 (CET)*/ /*Generated on:Tue Feb 19 2019 00:29:30 GMT+0100 (CET)*/
/* /*
* Dexie.js - a minimalistic wrapper for IndexedDB * Dexie.js - a minimalistic wrapper for IndexedDB
* =============================================== * ===============================================
@@ -18431,7 +18431,9 @@
Check_Call_Police_Active() { Check_Call_Police_Active() {
let self = this; let self = this;
if (($('#h2_prisoners').length > 0 || $('img.patientPrisonerIcon').length > 0) && !self.includesString($('#missionH1').text(),'[verband]')) { if (($('#h2_prisoners').length > 0 || $('img.patientPrisonerIcon').length > 0) /*&& !self.includesString($('#missionH1').text(),'[verband]')*/) {
//TODO: check if Verband or Event and
// Maybe done with //__FIXX__20192
self.Collect_Jails(); self.Collect_Jails();
} else { } else {
let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
@@ -18455,6 +18457,8 @@
// Gefängnis auswählen // Gefängnis auswählen
Collect_Jails() { Collect_Jails() {
// TODO: hardening the processing for verband/event missions
// Maybe done with the //__FIXX__20192
let self = this; let self = this;
self.Jails = []; self.Jails = [];
var CountGefangene = Number(parseInt($('#h2_prisoners').text())); var CountGefangene = Number(parseInt($('#h2_prisoners').text()));
@@ -18603,12 +18607,19 @@
self.Send_Vehicle_To_Jail() self.Send_Vehicle_To_Jail()
} else { } else {
$("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => { $("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => {
var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id")); //__FIXX__20192
if (CalledVehicleID == 52) { let me = $(elem).find('td:nth-child(5) > a:contains("Jomaar")').length;
CountGefangene -= 5; if (me > 0) {
} else if (CalledVehicleID == 32) { //__FIXX__20192
CountGefangene -= 1; var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id"));
if (CalledVehicleID == 52) {
CountGefangene -= 5;
} else if (CalledVehicleID == 32) {
CountGefangene -= 1;
}
//__FIXX__20192
} }
//__FIXX__20192
}); });
if ($('#vehicle_show_table_all tr[vehicle_type="GefKw"] input[type="checkbox"]').length > 0 && CountGefangene >= 5) { if ($('#vehicle_show_table_all tr[vehicle_type="GefKw"] input[type="checkbox"]').length > 0 && CountGefangene >= 5) {
+17 -6
View File
@@ -632,7 +632,9 @@
Check_Call_Police_Active() { Check_Call_Police_Active() {
let self = this; let self = this;
if (($('#h2_prisoners').length > 0 || $('img.patientPrisonerIcon').length > 0) && !self.includesString($('#missionH1').text(),'[verband]')) { if (($('#h2_prisoners').length > 0 || $('img.patientPrisonerIcon').length > 0) /*&& !self.includesString($('#missionH1').text(),'[verband]')*/) {
//TODO: check if Verband or Event and
// Maybe done with //__FIXX__20192
self.Collect_Jails(); self.Collect_Jails();
} else { } else {
let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1); let MissionID = document.location.pathname.substr(document.location.pathname.lastIndexOf("/") + 1);
@@ -656,6 +658,8 @@
// Gefängnis auswählen // Gefängnis auswählen
Collect_Jails() { Collect_Jails() {
// TODO: hardening the processing for verband/event missions
// Maybe done with the //__FIXX__20192
let self = this; let self = this;
self.Jails = []; self.Jails = [];
var CountGefangene = Number(parseInt($('#h2_prisoners').text())); var CountGefangene = Number(parseInt($('#h2_prisoners').text()));
@@ -804,12 +808,19 @@
self.Send_Vehicle_To_Jail() self.Send_Vehicle_To_Jail()
} else { } else {
$("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => { $("#mission_vehicle_driving tbody, #mission_vehicle_at_mission tbody").find("tr").each((_, elem) => {
var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id")); //__FIXX__20192
if (CalledVehicleID == 52) { let me = $(elem).find('td:nth-child(5) > a:contains("Jomaar")').length;
CountGefangene -= 5; if (me > 0) {
} else if (CalledVehicleID == 32) { //__FIXX__20192
CountGefangene -= 1; var CalledVehicleID = parseInt($(elem).find("a").first().attr("vehicle_type_id"));
if (CalledVehicleID == 52) {
CountGefangene -= 5;
} else if (CalledVehicleID == 32) {
CountGefangene -= 1;
}
//__FIXX__20192
} }
//__FIXX__20192
}); });
if ($('#vehicle_show_table_all tr[vehicle_type="GefKw"] input[type="checkbox"]').length > 0 && CountGefangene >= 5) { if ($('#vehicle_show_table_all tr[vehicle_type="GefKw"] input[type="checkbox"]').length > 0 && CountGefangene >= 5) {