.qc (dot qc) - the group for quake c coders of all denominations. If you make quake one mods and write code in quake c, join our group! I'll try to answer any quake c questions - please post your inquiry in the forums...
Posts | ||
---|---|---|
This is a "wrap" - coding smarter, not harder | Locked | |
Thread Options | ||
|
Oct 26 2014 Anchor | |
We're having a wrap party! What you say? A "wrapper" is a qc (or C) function that envelops or wraps another function. In quake-c if you call precache after map load the engine will crash. If you start coding dynamic items, random monsters and the like, you will be fixing this over and over. Here is a one shot "wrap" fix... Much quake-c code calls "precache_model" - we can wrap that by coding our own function. // first - rename the built-in function call for precache - in defs.qc //string (string s) precache_model = #20; // now make our wrapper function string (string s) precache_model = I used 5 seconds just to be on the safe side. Really calling precache after 1 second will usually cause the server to bomb out. That is what I call working smarter. Edited by: numbersix |
Only registered members can share their thoughts. So come on! Join the community today (totally free - or sign in with your social account on the right) and join in the conversation.