Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#2842 closed enhancement (invalid)

[PATCH] Allow ReRegistering a Global even when not hotloading.

Reported by: Radagast Owned by:
Priority: Nice to Have Milestone:
Component: Core engine Keywords: patch
Cc: Patch:

Description

Currently only hotloading allows to reregister a global. It would be nice to allow to reregister globals too to increase moddability (without that the whole file has to be copied which is difficult to maintain).

Attachments (1)

allow_reregistering_of_globals.diff (2.0 KB ) - added by Radagast 10 years ago.
a proposal

Download all attachments as: .zip

Change History (6)

by Radagast, 10 years ago

a proposal

comment:1 by Stan, 10 years ago

Keywords: review patch added

comment:2 by Itms, 10 years ago

Hello Rada, your patch doesn't compile, you have forgotten to add the function definition to the header file.

About the requested functionality, I don't think it's a good idea: as explained in the RegisterGlobal function, resetting globals is unsafe. When a mod has to modify a global, it's probably better to change the scope of the variable in the public mod (as in #2671). Some globals shouldn't be moddable.

Unless you can think of situations where what this ticket proposes is wanted, I think the request here is invalid. Tell us :)

comment:3 by Radagast, 10 years ago

Your words make sense. I did quickly throw this patch together when I encountered a global-related error when modding the GUI. The error in the meantime could be resolved. Not only is this proposal untested, it's also absolutely invalid. Thanks for caring.

comment:4 by Radagast, 10 years ago

Resolution: invalid
Status: newclosed

comment:5 by leper, 10 years ago

Keywords: review removed
Milestone: Alpha 18
Note: See TracTickets for help on using tickets.