v2 up amoac0ßav

This commit is contained in:
2018-11-28 21:15:38 +01:00
parent ef331ec550
commit ce599faaf6
3 changed files with 34 additions and 26 deletions

View File

@@ -274,6 +274,8 @@ class AutomaticDispose {
// Krankenhaus auswählen
Collect_Hospitals() {
let that = this;
that.Hospitals = [];
if ($("h4:contains('Eigene Krankenhäuser')").length > 0) {
$("h4:contains('Eigene Krankenhäuser')").next("table").find("tbody").find("tr").each(function () {
var HospitalHref = $(this).find("a:contains('Anfahren')").attr("href");
@@ -288,7 +290,7 @@ class AutomaticDispose {
}
if (HospitalFreeBeds > 0) {
Hospitals.push({
that.Hospitals.push({
"id": HospitalID,
"value": HospitalValue,
"distance": HospitalDistance,
@@ -328,7 +330,7 @@ class AutomaticDispose {
}
if (HospitalFreeBeds > 0 && HospitalSpecialDepartment) {
Hospitals.push({
that.Hospitals.push({
"id": HospitalID,
"value": HospitalValue,
"taxes": HospitalTaxes,
@@ -339,18 +341,18 @@ class AutomaticDispose {
});
}
Hospitals.sort(function (a, b) {
that.Hospitals.sort(function (a, b) {
return a.value - b.value;
});
Hospitals.reverse();
that.Hospitals.reverse();
this.Send_Vehicle_To_Hospital()
}
// Krankenhaus einlieferung
Send_Vehicle_To_Hospital() {
//var HospitalID = Hospitals[0].id;
var HospitalHref = Hospitals[0].href;
var HospitalHref = this.Hospitals[0].href;
// TODO: tellParent("ADisMissionDone(" + window.name + "," + MissionID + ");");
document.location.href = document.location.origin + HospitalHref;
@@ -461,6 +463,8 @@ class AutomaticDispose {
// Gefängnis auswählen
Collect_Jails() {
let that = this;
that.Jails = [];
var CountGefangene = Number(parseInt($('#h2_prisoners').text()));
var parentNode = $('#mission_vehicle_at_mission tr > td:nth-child(5) > a:contains("Jomaar")').parent().parent();
var GefKw = parentNode.find('td:nth-child(2) > a[vehicle_type_id="52"]');
@@ -516,7 +520,7 @@ class AutomaticDispose {
}
if (JailFreeBeds >= 5) {
Jails.push({
that.Jails.push({
"id": JailID,
"value": JailValue + 1000,
"text": JailText,
@@ -524,7 +528,7 @@ class AutomaticDispose {
"href": JailHref
});
} else if (JailFreeBeds >= 1) {
Jails.push({
that.Jails.push({
"id": JailID,
"value": JailValue,
"text": JailText,
@@ -580,7 +584,7 @@ class AutomaticDispose {
}
if (JailFreeBeds >= CountGefangene) {
Jails.push({
that.Jails.push({
"id": JailID,
"value": JailValue + 1000,
"text": JailText,
@@ -588,7 +592,7 @@ class AutomaticDispose {
"href": JailHref
});
} else if (JailFreeBeds >= 1) {
Jails.push({
that.Jails.push({
"id": JailID,
"value": JailValue,
"text": JailText,
@@ -598,11 +602,11 @@ class AutomaticDispose {
}
});
Jails.sort(function (a, b) {
that.Jails.sort(function (a, b) {
return a.value - b.value;
});
Jails.reverse();
that.Jails.reverse();
if (Jails.length > 0) {
this.Send_Vehicle_To_Jail()
} else {
@@ -639,7 +643,7 @@ class AutomaticDispose {
// Gefängnis einlieferung
Send_Vehicle_To_Jail() {
var JailHref = Jails[0].href
var JailHref = that.Jails[0].href
document.location.href = document.location.origin + JailHref;
}