# Patch name: local@funs.172p21 (Global @funs with Local Registers) # Patch version: 1.0 # Author's name: Rick Bird # Author's email: nveid@yahoo.com # Version of PennMUSH: 1.7.2p21 # Date patch made: 3/26/99 # Author is willing to support (yes/no): yes # Patch format: diff -c # # # This is a contributed PennMUSH patch. Its use is subject to the # same restrictions found in PennMUSH's hdrs/copyrite.h file. # # No warranty is given for this patch. It is not necessarily going # to work on your system, with any version of PennMUSH other than # the one above, etc. # # If the author given above was willing to support the patch, you # should write to the author if you have any questions or problems. Do # *NOT* send email messages to Javelin or any PennMUSH mailing list about # this patch! # # Below this line is the author's description of the patch, # followed by the patch itself. If the patch is in context diff # format, you'll probably apply it by typing: patch < patchfile # in your top-level MUSH directory, unless instructed otherwise # below. # # This makes the Global @funs Act in the manner of Ulocal() # instead of normal ufun()s, in other words Global @funs # have there own local registers(%q0-9) # Once you patch this you must insert a line into the mush.cnf # local_globalufuns 1 # Actually, it automatically is turned on.. But if you want it to # be turned off, simply put in local_globalufuns 0. # have fun, :) *** ../clean/pennmush/src/conf.c Wed Mar 3 10:07:09 1999 --- ./src/conf.c Tue Mar 23 17:02:11 1999 *************** *** 136,141 **** --- 136,142 ---- {"warn_interval", cf_int, &options.warn_interval, 32000, 0, "dump"}, #endif {"haspower_restricted", cf_bool, &options.haspower_restricted, 2, 0, "funcs"}, + {"local_globalufuns", cf_bool, &options.local_globalufuns, 2, 0, "funcs"}, {"safer_ufun", cf_bool, &options.safer_ufun, 2, 0, "funcs"}, {"dump_warning_1min", cf_str, (int *) options.dump_warning_1min, 256, 0, "dump"}, {"dump_warning_5min", cf_str, (int *) options.dump_warning_5min, 256, 0, "dump"}, *************** *** 489,494 **** --- 490,496 ---- #endif options.use_dns = 1; options.haspower_restricted = 0; + options.local_globalufuns = 1; options.safer_ufun = 1; strcpy(options.dump_warning_1min, "GAME: Database will be dumped in 1 minute."); strcpy(options.dump_warning_5min, "GAME: Database will be dumped in 5 minutes."); *** ../clean/pennmush/src/parse.c Wed Mar 3 10:07:33 1999 --- ./src/parse.c Fri Mar 26 14:11:02 1999 *************** *** 763,771 **** safe_chr('/', buff, bp); safe_str(userfn_tab[GF_Index(fp->ftype)].name, buff, bp); safe_chr(')', buff, bp); ! } else do_userfn(buff, bp, thing, attrib, nfargs, fargs, executor, caller, enactor, pe_info); } pe_info->fun_depth--; global_fun_recursions--; --- 763,781 ---- safe_chr('/', buff, bp); safe_str(userfn_tab[GF_Index(fp->ftype)].name, buff, bp); safe_chr(')', buff, bp); ! } else { ! if(options.local_globalufuns) { ! char *preserve[10]; ! save_global_regs("gufun.save", preserve); ! ! do_userfn(buff, bp, thing, attrib, nfargs, fargs, ! executor, caller, enactor, pe_info); ! restore_global_regs("gufun.save", preserve); ! } else ! do_userfn(buff, bp, thing, attrib, nfargs, fargs, executor, caller, enactor, pe_info); + } } pe_info->fun_depth--; global_fun_recursions--; *** ../clean/pennmush/hdrs/conf.h Wed Mar 3 10:06:44 1999 --- ./hdrs/conf.h Tue Mar 23 16:58:07 1999 *************** *** 181,186 **** --- 181,187 ---- int base_room; int use_dns; int haspower_restricted; + int local_globalufuns; int safer_ufun; char dump_warning_1min[256]; char dump_warning_5min[256];