Add check to internal methods to prevent crash
(cherry picked from commit 448295cd51
)
This commit is contained in:
parent
9fd201c7a4
commit
eb31a39e82
2 changed files with 2 additions and 0 deletions
|
@ -1177,6 +1177,7 @@ void TileMap::_set_tile_data(const PoolVector<int> &p_data) {
|
||||||
PoolVector<int>::Read r = p_data.read();
|
PoolVector<int>::Read r = p_data.read();
|
||||||
|
|
||||||
int offset = (format == FORMAT_2) ? 3 : 2;
|
int offset = (format == FORMAT_2) ? 3 : 2;
|
||||||
|
ERR_FAIL_COND_MSG(c % offset != 0, "Corrupted tile data.");
|
||||||
|
|
||||||
clear();
|
clear();
|
||||||
for (int i = 0; i < c; i += offset) {
|
for (int i = 0; i < c; i += offset) {
|
||||||
|
|
|
@ -128,6 +128,7 @@ void ProximityGroup::broadcast(String p_method, Variant p_parameters) {
|
||||||
|
|
||||||
void ProximityGroup::_proximity_group_broadcast(String p_method, Variant p_parameters) {
|
void ProximityGroup::_proximity_group_broadcast(String p_method, Variant p_parameters) {
|
||||||
if (dispatch_mode == MODE_PROXY) {
|
if (dispatch_mode == MODE_PROXY) {
|
||||||
|
ERR_FAIL_COND(!is_inside_tree());
|
||||||
get_parent()->call(p_method, p_parameters);
|
get_parent()->call(p_method, p_parameters);
|
||||||
} else {
|
} else {
|
||||||
emit_signal("broadcast", p_method, p_parameters);
|
emit_signal("broadcast", p_method, p_parameters);
|
||||||
|
|
Loading…
Reference in a new issue