diff options
Diffstat (limited to 'core/event_queue.cpp')
-rw-r--r-- | core/event_queue.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/core/event_queue.cpp b/core/event_queue.cpp index cf6e742f79..1afd686f86 100644 --- a/core/event_queue.cpp +++ b/core/event_queue.cpp @@ -5,7 +5,7 @@ /* GODOT ENGINE */ /* http://www.godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2007-2015 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -56,28 +56,36 @@ Error EventQueue::push_call(uint32_t p_instance_ID, const StringName& p_method, buffer_end+=sizeof(Event); - if (args==1) { + if (args>=1) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg1; - } else if (args==2) { + } + + if (args>=2) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg2; - } else if (args==3) { + } + + if (args>=3) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg3; - } else if (args==4) { + } + + if (args>=4) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); *v=p_arg4; - } else if (args==5) { + } + + if (args>=5) { Variant * v = memnew_placement( &event_buffer[ buffer_end ], Variant ); buffer_end+=sizeof(Variant); |