L
Lunnig149
Guest
I am currently (=quite some while) struggling with the following piece of code and just can not put my finger onto what is going wrong. Any kind of hint or idea is highly appreciated.
(I am afraid it is something obvious and I am about the embarrass myself xD)
Problem Description:
version_1: works for a while (times differ from run to run), but after the collision with certain objects the game simply crashes (game works perfectly fine without this section of code).
version_2: works fine
version_3: works fine
versions only differ in the collision_rectangle_list and only in the object checked for)
(I am afraid it is something obvious and I am about the embarrass myself xD)
Problem Description:
version_1: works for a while (times differ from run to run), but after the collision with certain objects the game simply crashes (game works perfectly fine without this section of code).
version_2: works fine
version_3: works fine
versions only differ in the collision_rectangle_list and only in the object checked for)
Code:
//// Healing if a object with hp moves into it
/*version_1*/ var _num_list = collision_rectangle_list(bbox_left , bbox_top , bbox_right , bbox_bottom , all , false , false , list_collision , false);
/*version_2*/ var _num_list = collision_rectangle_list(bbox_left , bbox_top , bbox_right , bbox_bottom , oCharacter , false , false , list_collision , false);
/*version_3*/ var _num_list = collision_rectangle_list(bbox_left , bbox_top , bbox_right , bbox_bottom , id_creator , false , false , list_collision , false);
if (_num_list > 0) {
for (var i = 0 ; i < _num_list ; i++) {
var _inst_checked = list_collision[| i];
if (instance_exists(_inst_checked)) {
with (_inst_checked) {
/// some actions removed for debugging
/// error still happening with out this section
}
}
}
}
}
ds_list_clear(list_collision);