actual bad lines are this three;
FONT* font1 = "Arial#18b";
VECTOR* tmp;
VECTOR* tmp2;
on runtime you have to create fonts with font_create,
FONT* font1 = font_create("Arial#18b");
and then, tmp and tmp2 are just VECTOR pointers and not VECTORs and they are currently pointing to nothing, if you try to use them youll get a crash.
so change this lines:
VECTOR* tmp;
VECTOR* tmp2;
with:
VECTOR tmp;
VECTOR tmp2;
---
and before sitting in front of it 3 hours, and thinking it can only be a bug, check the manual.